Home
last modified time | relevance | path

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

12345

/frameworks/base/core/tests/coretests/src/android/os/
DFileUtilsTest.java19 import static android.os.FileUtils.roundStorageSize;
30 import android.os.FileUtils.MemoryPipe;
77 FileUtils.deleteContents(mTarget); in setUp()
83 FileUtils.deleteContents(mTarget); in tearDown()
92 FileUtils.copyFile(mTestFile, mCopyFile); in testCopyFile()
94 assertEquals(TEST_DATA, FileUtils.readTextFile(mCopyFile, 0, null)); in testCopyFile()
101 FileUtils.copyToFile(new ByteArrayInputStream(s.getBytes()), mCopyFile); in testCopyToFile()
103 assertEquals(s, FileUtils.readTextFile(mCopyFile, 0, null)); in testCopyToFile()
119 FileUtils.copy(in, out); in testCopy_FileToFile()
139 FileUtils.copy(in.getFD(), out.getFD()); in testCopy_FileToPipe()
[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;
134 FileUtils.setPermissions( in startWrite()
136 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in startWrite()
155 FileUtils.sync(str); in finishWrite()
176 FileUtils.sync(str); in failWrite()
193 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()
219 FileUtils.copyFile(new File("../propLoader.gradle"), in prepareApp()
221 FileUtils.copyFile(new File("../gradlew"), new File(testFolder, "gradlew")); in prepareApp()
[all …]
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/
DLastMileLoggerTest.java27 import android.os.FileUtils;
61 FileUtils.stringToFile(mTraceEnableFile, "0"); in setUp()
218 FileUtils.stringToFile(mTraceDataFile.getPath(), "rdev_connect"); in dumpShowsFailureTrace()
229 FileUtils.stringToFile(mTraceDataFile.getPath(), "rdev_connect"); in dumpShowsFailureTraceEvenIfConnectionIdIncreases()
240 FileUtils.stringToFile(mTraceDataFile.getPath(), "rdev_connect"); in dumpShowsPendingConnectionTrace()
250 FileUtils.stringToFile(mTraceDataFile.getPath(), "rdev_connect try #1"); in dumpShowsLastFailureTraceAndPendingConnectionTrace()
255 FileUtils.stringToFile(mTraceDataFile.getPath(), "rdev_connect try #2"); in dumpShowsLastFailureTraceAndPendingConnectionTrace()
266 FileUtils.stringToFile(mTraceDataFile.getPath(), "rdev_connect try #1"); in dumpShowsLastFailureTraceAndCurrentConnectionTrace()
271 FileUtils.stringToFile(mTraceDataFile.getPath(), "rdev_connect try #2"); in dumpShowsLastFailureTraceAndCurrentConnectionTrace()
284 FileUtils.stringToFile(mTraceDataFile.getPath(), "rdev_connect"); in dumpDoesNotClearLastFailureData()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/
DMountServiceTests.java22 import android.os.FileUtils;
117 FileUtils.setPermissions(outFile.getPath(), FileUtils.S_IRWXU | FileUtils.S_IRWXG in copyRawToFile()
118 | FileUtils.S_IRWXO, -1, -1); in copyRawToFile()
119 assertTrue(FileUtils.copyToFile(is, outFile)); in copyRawToFile()
120 FileUtils.setPermissions(outFile.getPath(), FileUtils.S_IRWXU | FileUtils.S_IRWXG in copyRawToFile()
121 | 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/services/core/java/com/android/server/pm/
DUserDataPreparer.java24 import android.os.FileUtils;
144 FileUtils.deleteContentsAndDir(getUserSystemDirectory(userId)); in destroyUserDataLI()
145 FileUtils.deleteContentsAndDir(getDataSystemDeDirectory(userId)); in destroyUserDataLI()
148 FileUtils.deleteContentsAndDir(getDataSystemCeDirectory(userId)); in destroyUserDataLI()
168 Collections.addAll(files, FileUtils in reconcileUsers()
170 Collections.addAll(files, FileUtils in reconcileUsers()
172 Collections.addAll(files, FileUtils in reconcileUsers()
174 Collections.addAll(files, FileUtils in reconcileUsers()
176 Collections.addAll(files, FileUtils in reconcileUsers()
/frameworks/base/core/tests/benchmarks/src/android/os/
DFileUtilsBenchmark.java19 import static android.os.FileUtils.copyInternalSendfile;
20 import static android.os.FileUtils.copyInternalSplice;
21 import static android.os.FileUtils.copyInternalUserspace;
23 import android.os.FileUtils.MemoryPipe;
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/
DUserDataPreparerTest.java21 import android.os.FileUtils;
81 FileUtils.deleteContents(ctx.getCacheDir()); in setup()
139 assertEquals(Collections.singletonList(ceFile), Arrays.asList(FileUtils.listFilesOrEmpty( in testDestroyUserData()
145 assertEquals(Collections.emptyList(), Arrays.asList(FileUtils.listFilesOrEmpty( in testDestroyUserData()
165 assertEquals(Collections.emptyList(), Arrays.asList(FileUtils.listFilesOrEmpty(systemDir))); in testDestroyUserData_De()
166 assertEquals(Collections.emptyList(), Arrays.asList(FileUtils.listFilesOrEmpty( in testDestroyUserData_De()
183 assertEquals(Collections.emptyList(), Arrays.asList(FileUtils.listFilesOrEmpty( in testDestroyUserData_Ce()
/frameworks/base/core/java/android/database/sqlite/
DSQLiteOpenHelper.java26 import android.os.FileUtils;
426 int perms = FileUtils.S_IRUSR | FileUtils.S_IWUSR | FileUtils.S_IRGRP | FileUtils.S_IWGRP; in setFilePermissionsForDb()
427 FileUtils.setPermissions(dbPath, perms, -1, -1); in setFilePermissionsForDb()
/frameworks/data-binding/compilerCommon/src/main/java/android/databinding/tool/
DLayoutXmlProcessor.java18 import org.apache.commons.io.FileUtils;
113 FileUtils.deleteDirectory(input.getRootOutputFolder()); in processAllInputFiles()
172 FileUtils.copyFile(file, new File(outParent, file.getName())); in processResources()
179 FileUtils.deleteQuietly(out); in processResources()
185 FileUtils.deleteQuietly(new File(outParent, file.getName())); in processResources()
204 FileUtils.copyDirectory(file, outFile); in processResources()
206 FileUtils.copyFile(file, outFile); in processResources()
213 FileUtils.deleteQuietly(outFile); in processResources()
244 FileUtils.deleteQuietly(new File(xmlOutDir, exportFileName)); in writeLayoutInfoFiles()
/frameworks/base/services/core/java/com/android/server/updates/
DCertificateTransparencyLogInstallReceiver.java20 import android.os.FileUtils;
79 FileUtils.deleteContentsAndDir(newVersion); in install()
117 FileUtils.deleteContentsAndDir(newVersion); in install()
178 FileUtils.deleteContentsAndDir(f); in deleteOldLogDirectories()
/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/opt/net/wifi/service/java/com/android/server/wifi/
DLastMileLogger.java19 import android.os.FileUtils;
117 FileUtils.stringToFile(mEventEnablePath, "1"); in enableTracing()
125 FileUtils.stringToFile(mEventEnablePath, "0"); in disableTracing()
/frameworks/base/services/usb/java/com/android/server/usb/
DUsbDebuggingManager.java32 import android.os.FileUtils;
415 FileUtils.setPermissions(keyFile.toString(), in writeKey()
416 FileUtils.S_IRUSR | FileUtils.S_IWUSR | in writeKey()
417 FileUtils.S_IRGRP, -1, -1); in writeKey()
469 FileUtils.readTextFile(new File("/data/misc/adb/adb_keys"), 0, null)); in dump()
476 FileUtils.readTextFile(new File("/adb_keys"), 0, null)); in dump()
/frameworks/base/core/java/com/android/internal/content/
DFileSystemProvider.java34 import android.os.FileUtils;
113 return FileUtils.contains(parent, doc); in isChildDocument()
165 if (!FileUtils.contains(parent, doc)) { in findDocumentPath()
170 while (doc != null && FileUtils.contains(parent, doc)) { in findDocumentPath()
182 displayName = FileUtils.buildValidFatFilename(displayName); in createDocument()
189 final File file = FileUtils.buildUniqueFile(parent, mimeType, displayName); in createDocument()
236 displayName = FileUtils.buildValidFatFilename(displayName); in renameDocument()
239 final File after = FileUtils.buildUniqueFile(before.getParentFile(), displayName); in renameDocument()
321 FileUtils.deleteContents(file); in deleteDocument()
/frameworks/base/packages/Shell/src/com/android/shell/
DBugreportReceiver.java31 import android.os.FileUtils;
79 FileUtils.deleteOlderFiles(bugreportFile.getParentFile(), minCount, minAge); in cleanupOldFiles()
/frameworks/base/core/tests/coretests/src/com/android/internal/os/
DKernelCpuProcReaderTest.java25 import android.os.FileUtils;
73 FileUtils.deleteContents(mTestDir); in tearDown()
74 FileUtils.deleteContents(mRoot); in tearDown()
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/hotspot2/
DLegacyPasspointConfigParserTest.java21 import android.os.FileUtils;
113 FileUtils.stringToFile(configFile, data); in parseConfig()
/frameworks/data-binding/compiler/src/main/java/android/databinding/tool/util/
DGenerationalClassUtil.java19 import org.apache.commons.io.FileUtils;
92 for (File file : FileUtils.listFiles(directory, TrueFileFilter.INSTANCE, in loadFromDirectory()
98 inputStream = FileUtils.openInputStream(file); in loadFromDirectory()
/frameworks/base/core/tests/coretests/src/android/content/res/
DResourcesLocaleTest.java18 import android.os.FileUtils;
38 FileUtils.copyToFileOrThrow(is, path); in extractApkAndGetPath()
/frameworks/base/core/tests/packagemanagertests/src/android/content/pm/
DKernelPackageMappingTests.java26 import android.os.FileUtils;
76 return FileUtils.readTextFile(file, 0, null).trim(); in getContent()
/frameworks/base/core/java/com/android/server/
DBootReceiver.java27 import android.os.FileUtils;
155 return FileUtils.readTextFile(lastHeaderFile, 0, null); in getPreviousBootHeaders()
170 .append(FileUtils.readTextFile(new File("/proc/version"), 1024, "...\n")) in getCurrentBootHeaders()
180 FileUtils.stringToFile(lastHeaderFile, newHeaders); in getBootHeadersToLogAndUpdate()
304 String fileContents = FileUtils.readTextFile(file, maxSize, "[[TRUNCATED]]\n"); in addFileWithFootersToDropBox()
345 String log = FileUtils.readTextFile(file, maxSize, "[[TRUNCATED]]\n"); in addAuditErrorsToDropBox()
370 String log = FileUtils.readTextFile(file, maxSize, "[[TRUNCATED]]\n"); in addFsckErrorsToDropBoxAndLogFsStat()
413 metricsStr = FileUtils.readTextFile(metricsFile, 0, null); in logSystemServerShutdownTimeMetrics()
525 lines = FileUtils.readTextFile(f, -maxReadSize, null); in logFsShutdownTime()

12345