Home
last modified time | relevance | path

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

12

/frameworks/base/core/tests/coretests/src/android/os/
DFileUtilsTest.java60 FileUtils.copyFile(mTestFile, mCopyFile); in testCopyFile()
62 assertEquals(TEST_DATA, FileUtils.readTextFile(mCopyFile, 0, null)); in testCopyFile()
69FileUtils.copyToFile(new ByteArrayInputStream(s.getBytes()), mCopyFile); assertTrue(mCopyFi… in testCopyToFile()
70 assertEquals(s, FileUtils.readTextFile(mCopyFile, 0, null)); in testCopyToFile()
75 assertTrue(FileUtils.isFilenameSafe(new File("foobar"))); in testIsFilenameSafe()
76 assertTrue(FileUtils.isFilenameSafe(new File("a_b-c=d.e/0,1+23"))); in testIsFilenameSafe()
77 assertFalse(FileUtils.isFilenameSafe(new File("foo*bar"))); in testIsFilenameSafe()
78 assertFalse(FileUtils.isFilenameSafe(new File("foo\nbar"))); in testIsFilenameSafe()
83 assertEquals(TEST_DATA, FileUtils.readTextFile(mTestFile, 0, null)); in testReadTextFile()
85 assertEquals("ABCDE", FileUtils.readTextFile(mTestFile, 5, null)); in testReadTextFile()
[all …]
DBinderThreadPriorityTest.java100 String cgroup = FileUtils.readTextFile(new File(fn), 1024, null); in getSchedulerGroup()
/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/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/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;
97 FileUtils.sync(fos); in generateNewKey()
99 FileUtils.setPermissions(keyFile.getName(), (FileUtils.S_IRUSR | FileUtils.S_IWUSR), in generateNewKey()
/frameworks/base/core/java/com/android/internal/content/
DPackageHelper.java19 import android.os.FileUtils;
247 FileUtils.sync(fstr); in extractPublicFiles()
249 FileUtils.setPermissions(publicZipFile.getAbsolutePath(), FileUtils.S_IRUSR in extractPublicFiles()
250 | FileUtils.S_IWUSR | FileUtils.S_IRGRP | FileUtils.S_IROTH, -1, -1); in extractPublicFiles()
/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/services/java/com/android/server/usb/
DUsbDebuggingManager.java27 import android.os.FileUtils;
274 FileUtils.setPermissions(keyFile.toString(), in writeKey()
275 FileUtils.S_IRUSR | FileUtils.S_IWUSR | in writeKey()
276 FileUtils.S_IRGRP, -1, -1); in writeKey()
313 pw.println(FileUtils.readTextFile(new File("/data/misc/adb/adb_keys"), 0, null)); in dump()
319 pw.println(FileUtils.readTextFile(new File("/adb_keys"), 0, null)); in dump()
DUsbDeviceManager.java33 import android.os.FileUtils;
249 FileUtils.stringToFile(RNDIS_ETH_ADDR_PATH, addrString); in initRndisAddress()
347 String state = FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim(); in UsbHandler()
760 + FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim()); in dump()
762 + FileUtils.readTextFile(new File(FUNCTIONS_PATH), 0, null).trim()); in dump()
764 + FileUtils.readTextFile(new File(MASS_STORAGE_FILE_PATH), 0, null).trim()); in dump()
800 FileUtils.stringToFile(MASS_STORAGE_FILE_PATH, path); in setMassStorageBackingFile()
/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/base/core/java/android/app/
DContextImpl.java83 import android.os.FileUtils;
710 FileUtils.setPermissions( in openFileOutput()
712 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in openFileOutput()
736 FileUtils.setPermissions( in getFilesDir()
738 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in getFilesDir()
799 FileUtils.setPermissions( in getCacheDir()
801 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in getCacheDir()
1820 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH); in getDir()
1923 int perms = FileUtils.S_IRUSR|FileUtils.S_IWUSR in setFilePermissionsFromMode()
1924 |FileUtils.S_IRGRP|FileUtils.S_IWGRP in setFilePermissionsFromMode()
[all …]
DSharedPreferencesImpl.java20 import android.os.FileUtils;
550 FileUtils.setPermissions( in createFileOutputStream()
552 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in createFileOutputStream()
597 FileUtils.sync(str); in writeToFile()
/frameworks/base/services/java/com/android/server/
DBootReceiver.java27 import android.os.FileUtils;
107 .append(FileUtils.readTextFile(new File("/proc/version"), 1024, "...\n")) in logBootEvents()
175 db.addText(tag, headers + FileUtils.readTextFile(file, maxSize, "[[TRUNCATED]]\n")); in addFileToDropBox()
DCertBlacklister.java23 import android.os.FileUtils;
93 FileUtils.sync(out); in writeBlacklist()
DDiskStatsService.java22 import android.os.FileUtils;
DWallpaperManagerService.java46 import android.os.FileUtils;
746 FileUtils.setPermissions( in updateWallpaperBitmapLocked()
748 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in updateWallpaperBitmapLocked()
1250 FileUtils.sync(fos); in restoreNamedResourceLocked()
/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/
DSettingsBackupAgent.java28 import android.os.FileUtils;
337 FileUtils.setPermissions(FILE_WIFI_SUPPLICANT, in run()
338 FileUtils.S_IRUSR | FileUtils.S_IWUSR | in run()
339 FileUtils.S_IRGRP | FileUtils.S_IWGRP, in run()
507 FileUtils.setPermissions(FILE_WIFI_SUPPLICANT, in onRestoreFile()
508 FileUtils.S_IRUSR | FileUtils.S_IWUSR | in onRestoreFile()
509 FileUtils.S_IRGRP | FileUtils.S_IWGRP, in onRestoreFile()
/frameworks/base/services/java/com/android/server/pm/
DUserManagerService.java34 import android.os.FileUtils;
166 FileUtils.setPermissions(mUsersDir.toString(), in UserManagerService()
167 FileUtils.S_IRWXU|FileUtils.S_IRWXG in UserManagerService()
168 |FileUtils.S_IROTH|FileUtils.S_IXOTH, in UserManagerService()
378 FileUtils.setPermissions( in writeBitmapLocked()
380 FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, in writeBitmapLocked()
DSettings.java50 import android.os.FileUtils;
181 FileUtils.setPermissions(mSystemDir.toString(), in Settings()
182 FileUtils.S_IRWXU|FileUtils.S_IRWXG in Settings()
183 |FileUtils.S_IROTH|FileUtils.S_IXOTH, in Settings()
1081 FileUtils.sync(fstr); in writePackageRestrictionsLPr()
1087 FileUtils.setPermissions(userPackagesStateFile.toString(), in writePackageRestrictionsLPr()
1088 FileUtils.S_IRUSR|FileUtils.S_IWUSR in writePackageRestrictionsLPr()
1089 |FileUtils.S_IRGRP|FileUtils.S_IWGRP, in writePackageRestrictionsLPr()
1326 FileUtils.sync(fstr); in writeLPr()
1332 FileUtils.setPermissions(mSettingsFilename.toString(), in writeLPr()
[all …]
/frameworks/base/core/java/android/speech/tts/
DFileSynthesisCallback.java19 import android.os.FileUtils;
92 FileUtils.setPermissions(mFileName.getAbsolutePath(), 0666, -1, -1); //-rw-rw-rw in closeFileAndWidenPermissions()
/frameworks/base/core/java/com/android/internal/util/
DFileRotator.java19 import android.os.FileUtils;
380 FileUtils.sync(fos); in writeFile()
/frameworks/base/core/java/android/os/
DFileUtils.java36 public class FileUtils { class
/frameworks/base/core/tests/coretests/src/android/content/pm/
DPackageManagerTests.java35 import android.os.FileUtils;
295 FileUtils.setPermissions(outFile.getPath(), in getInstallablePackage()
296 FileUtils.S_IRWXU | FileUtils.S_IRWXG | FileUtils.S_IRWXO, in getInstallablePackage()
298 assertTrue(FileUtils.copyToFile(is, outFile)); in getInstallablePackage()
299 FileUtils.setPermissions(outFile.getPath(), in getInstallablePackage()
300 FileUtils.S_IRWXU | FileUtils.S_IRWXG | FileUtils.S_IRWXO, in getInstallablePackage()

12