Home
last modified time | relevance | path

Searched refs:FileUtils (Results 1 – 25 of 59) sorted by relevance

123

/frameworks/base/core/tests/coretests/src/android/os/
DFileUtilsTest.java58 FileUtils.deleteContents(mTarget); in setUp()
64 FileUtils.deleteContents(mTarget); in tearDown()
72 FileUtils.copyFile(mTestFile, mCopyFile); in testCopyFile()
74 assertEquals(TEST_DATA, FileUtils.readTextFile(mCopyFile, 0, null)); in testCopyFile()
80 FileUtils.copyToFile(new ByteArrayInputStream(s.getBytes()), mCopyFile); in testCopyToFile()
82 assertEquals(s, FileUtils.readTextFile(mCopyFile, 0, null)); in testCopyToFile()
86 assertTrue(FileUtils.isFilenameSafe(new File("foobar"))); in testIsFilenameSafe()
87 assertTrue(FileUtils.isFilenameSafe(new File("a_b-c=d.e/0,1+23"))); in testIsFilenameSafe()
88 assertFalse(FileUtils.isFilenameSafe(new File("foo*bar"))); in testIsFilenameSafe()
89 assertFalse(FileUtils.isFilenameSafe(new File("foo\nbar"))); in testIsFilenameSafe()
[all …]
/frameworks/base/core/java/com/android/internal/os/
DAtomicFile.java19 import android.os.FileUtils;
76 FileUtils.setPermissions( in startWrite()
78 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in startWrite()
91 FileUtils.sync(str); in finishWrite()
103 FileUtils.sync(str); in failWrite()
125 FileUtils.sync(fos); in truncate()
/frameworks/base/core/java/android/util/
DAtomicFile.java19 import android.os.FileUtils;
108 FileUtils.setPermissions( in startWrite()
110 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in startWrite()
129 FileUtils.sync(str); in finishWrite()
146 FileUtils.sync(str); in failWrite()
163 FileUtils.sync(fos); in truncate()
/frameworks/data-binding/compilationTests/src/test/java/android/databinding/compilationTest/
DBaseCompilationTest.java19 import org.apache.commons.io.FileUtils;
90 for (File item : FileUtils.listFiles(folder, null, true)) { in copyResourceDirectory()
103 FileUtils.forceDelete(testFolder); in clear()
119 List<String> lines = FileUtils.readLines(file); in extract()
140 FileUtils.forceMkdir(directory); in copyResourceTo()
185 FileUtils.writeStringToFile(targetFile, out.toString()); in copyResourceTo()
209 FileUtils.forceMkdir(testFolder); in prepareApp()
217 FileUtils.copyFile(localProperties, new File(testFolder, "local.properties")); in prepareApp()
219FileUtils.copyFile(new File("../propLoader.gradle"), new File(testFolder, "propLoaderClone.gradle"… in prepareApp()
220 FileUtils.copyFile(new File("../gradlew"), new File(testFolder, "gradlew")); in prepareApp()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/
DMountServiceTests.java22 import android.os.FileUtils;
129 FileUtils.setPermissions(outFile.getPath(), FileUtils.S_IRWXU | FileUtils.S_IRWXG in copyRawToFile()
130 | FileUtils.S_IRWXO, -1, -1); in copyRawToFile()
131 assertTrue(FileUtils.copyToFile(is, outFile)); in copyRawToFile()
132 FileUtils.setPermissions(outFile.getPath(), FileUtils.S_IRWXU | FileUtils.S_IRWXG in copyRawToFile()
133 | FileUtils.S_IRWXO, -1, -1); in copyRawToFile()
DEntropyMixerTest.java20 import android.os.FileUtils;
34 assertEquals(0, FileUtils.readTextFile(file, 0, null).length()); in testInitialWrite()
39 assertTrue(FileUtils.readTextFile(file, 0, null).length() > 0); in testInitialWrite()
/frameworks/base/keystore/java/android/security/
DSystemKeyStore.java20 import android.os.FileUtils;
95 FileUtils.sync(fos); in generateNewKey()
97 FileUtils.setPermissions(keyFile.getName(), (FileUtils.S_IRUSR | FileUtils.S_IWUSR), in generateNewKey()
/frameworks/base/core/tests/coretests/src/android/os/storage/
DStorageManagerBaseTest.java27 import android.os.FileUtils;
237 FileUtils.setPermissions(outFile.getPath(), FileUtils.S_IRWXU | FileUtils.S_IRWXG in copyRawToFile()
238 | FileUtils.S_IRWXO, -1, -1); in copyRawToFile()
239 assertTrue(FileUtils.copyToFile(is, outFile)); in copyRawToFile()
240 FileUtils.setPermissions(outFile.getPath(), FileUtils.S_IRWXU | FileUtils.S_IRWXG in copyRawToFile()
241 | FileUtils.S_IRWXO, -1, -1); in copyRawToFile()
/frameworks/base/test-runner/src/android/test/
DRenamingDelegatingContext.java26 import android.os.FileUtils;
236 FileUtils.setPermissions( in getCacheDir()
238 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in getCacheDir()
/frameworks/data-binding/compilerCommon/src/main/java/android/databinding/tool/writer/
DJavaFileWriter.java16 import org.apache.commons.io.FileUtils;
30 FileUtils.writeStringToFile(exactPath, contents); in writeToFile()
/frameworks/base/services/usb/java/com/android/server/usb/
DUsbDebuggingManager.java29 import android.os.FileUtils;
413 FileUtils.setPermissions(keyFile.toString(), in writeKey()
414 FileUtils.S_IRUSR | FileUtils.S_IWUSR | in writeKey()
415 FileUtils.S_IRGRP, -1, -1); in writeKey()
461 pw.println(FileUtils.readTextFile(new File("/data/misc/adb/adb_keys"), 0, null)); in dump()
467 pw.println(FileUtils.readTextFile(new File("/adb_keys"), 0, null)); in dump()
/frameworks/base/core/java/com/android/server/
DBootReceiver.java27 import android.os.FileUtils;
107 .append(FileUtils.readTextFile(new File("/proc/version"), 1024, "...\n")) in logBootEvents()
207 … db.addText(tag, headers + FileUtils.readTextFile(file, maxSize, "[[TRUNCATED]]\n") + footers); in addFileWithFootersToDropBox()
232 String log = FileUtils.readTextFile(file, maxSize, "[[TRUNCATED]]\n"); in addAuditErrorsToDropBox()
253 String log = FileUtils.readTextFile(file, maxSize, "[[TRUNCATED]]\n"); in addFsckErrorsToDropBox()
/frameworks/base/core/java/com/android/internal/content/
DPackageHelper.java28 import android.os.FileUtils;
285 FileUtils.sync(fstr); in extractPublicFiles()
287 FileUtils.setPermissions(publicZipFile.getAbsolutePath(), FileUtils.S_IRUSR in extractPublicFiles()
288 | FileUtils.S_IWUSR | FileUtils.S_IRGRP | FileUtils.S_IROTH, -1, -1); in extractPublicFiles()
/frameworks/base/core/java/android/app/
DSharedPreferencesImpl.java21 import android.os.FileUtils;
554 FileUtils.setPermissions( in createFileOutputStream()
556 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in createFileOutputStream()
601 FileUtils.sync(str); in writeToFile()
DContextImpl.java55 import android.os.FileUtils;
401 FileUtils.setPermissions( in openFileOutput()
403 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in openFileOutput()
427 FileUtils.setPermissions( in createFilesDirLocked()
429 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in createFilesDirLocked()
1763 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH); in getDir()
1901 int perms = FileUtils.S_IRUSR|FileUtils.S_IWUSR in setFilePermissionsFromMode()
1902 |FileUtils.S_IRGRP|FileUtils.S_IWGRP in setFilePermissionsFromMode()
1905 perms |= FileUtils.S_IROTH; in setFilePermissionsFromMode()
1908 perms |= FileUtils.S_IWOTH; in setFilePermissionsFromMode()
[all …]
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/util/
DGenerationalClassUtil.java19 import org.apache.commons.io.FileUtils;
90 for (File file : FileUtils.listFiles(directory, TrueFileFilter.INSTANCE, in loadFromDirectory()
96 inputStream = FileUtils.openInputStream(file); in loadFromDirectory()
/frameworks/base/services/core/java/com/android/server/
DCertBlacklister.java23 import android.os.FileUtils;
93 FileUtils.sync(out); in writeBlacklist()
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/
DUserManagerServiceTest.java20 import android.os.FileUtils;
51 String s = FileUtils.readTextFile(restrictionsFile, 10000, ""); in testWriteReadApplicationRestrictions()
/frameworks/data-binding/compiler/src/main/java/android/databinding/annotationprocessor/
DProcessExpressions.java19 import org.apache.commons.io.FileUtils;
111 result.addEntry(layoutFile.getName(), FileUtils.readFileToString(layoutFile)); in createIntermediateFromLayouts()
140 FileUtils.write(new File(exportClassNamesTo), out); in writeResourceBundle()
/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/
DSettingsBackupAgent.java31 import android.os.FileUtils;
486 FileUtils.setPermissions(FILE_WIFI_SUPPLICANT, in run()
487 FileUtils.S_IRUSR | FileUtils.S_IWUSR | in run()
488 FileUtils.S_IRGRP | FileUtils.S_IWGRP, in run()
674 FileUtils.setPermissions(FILE_WIFI_SUPPLICANT, in onRestoreFile()
675 FileUtils.S_IRUSR | FileUtils.S_IWUSR | in onRestoreFile()
676 FileUtils.S_IRGRP | FileUtils.S_IWGRP, in onRestoreFile()
/frameworks/base/packages/ExternalStorageProvider/src/com/android/externalstorage/
DExternalStorageProvider.java30 import android.os.FileUtils;
323 return FileUtils.contains(parent, doc); in isChildDocument()
333 displayName = FileUtils.buildValidFatFilename(displayName); in createDocument()
340 final File file = FileUtils.buildUniqueFile(parent, mimeType, displayName); in createDocument()
362 displayName = FileUtils.buildValidFatFilename(displayName); in renameDocument()
384 FileUtils.deleteContents(file); in deleteDocument()
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/reflection/
DSdkUtil.java16 import org.apache.commons.io.FileUtils;
89 inputStream = FileUtils.openInputStream(apiFile); in ApiChecker()
/frameworks/base/packages/Shell/src/com/android/shell/
DBugreportStorageProvider.java23 import android.os.FileUtils;
145 !FileUtils.isValidExtFilename(name)) { in getFileForDocId()
/frameworks/support/tests/java/android/support/v4/provider/
DDocumentFileTest.java23 import android.os.FileUtils;
82 FileUtils.deleteContents(tmp); in resetRoot()
85 FileUtils.deleteContents(rootMeow); in resetRoot()
/frameworks/base/core/tests/coretests/src/android/content/pm/
DRegisteredServicesCacheTest.java20 import android.os.FileUtils;
67 FileUtils.deleteContents(mDataDir); in setUp()
166 FileUtils.copyToFile(new ByteArrayInputStream(oldFile.getBytes()), file); in testMigration()

123