/cts/tools/cfassembler/src/dxconvext/util/ |
D | FileUtils.java | 42 File file = new File(fileName); in readFile() local 43 return readFile(file); in readFile() 53 public static byte[] readFile(File file) { in readFile() argument 54 if (!file.exists()) { in readFile() 55 throw new RuntimeException(file + ": file not found"); in readFile() 58 if (!file.isFile()) { in readFile() 59 throw new RuntimeException(file + ": not a file"); in readFile() 62 if (!file.canRead()) { in readFile() 63 throw new RuntimeException(file + ": file not readable"); in readFile() 66 long longLength = file.length(); in readFile() [all …]
|
/cts/tests/tests/os/src/android/os/cts/ |
D | FileAccessPermissionTest.java | 53 File file = new File("/system"); in testSystemDirAccess() local 54 assertTrue(file.canRead()); in testSystemDirAccess() 55 assertFalse(file.canWrite()); in testSystemDirAccess() 57 File fakeSystemFile = new File(file, "test"); in testSystemDirAccess() 66 file = new File("/system/app"); in testSystemDirAccess() 67 assertTrue(file.canRead()); in testSystemDirAccess() 68 assertFalse(file.canWrite()); in testSystemDirAccess() 71 File[] allFiles = file.listFiles(); in testSystemDirAccess() 82 File file = new File("/system/app"); in testApksAlwaysReadable() local 85 File[] apkFiles = file.listFiles(new FilenameFilter() { in testApksAlwaysReadable() [all …]
|
D | ParcelFileDescriptorTest.java | 281 final ParcelFileDescriptor file = ParcelFileDescriptor.open( in testFileNormal() local 285 write(file, 7); in testFileNormal() 286 file.close(); in testFileNormal() 295 final ParcelFileDescriptor file = ParcelFileDescriptor.open( in testFileError() local 299 write(file, 8); in testFileError() 300 file.closeWithError("OMG BANANAS"); in testFileError() 309 final ParcelFileDescriptor file = ParcelFileDescriptor.open( in testFileDetach() local 313 file.detachFd(); in testFileDetach() 363 final File file = File.createTempFile("treble_clef_\ud834\udd1e", ".tmp"); in testFileNamesWithNonBmpChars() local 364 final ParcelFileDescriptor pfd = ParcelFileDescriptor.open(file, in testFileNamesWithNonBmpChars() [all …]
|
/cts/hostsidetests/appsecurity/test-apps/MultiUserStorageApp/src/com/android/cts/multiuserstorageapp/ |
D | MultiUserStorageTest.java | 51 for (File file : files) { in wipeTestFiles() 52 if (file.getName().startsWith(FILE_PREFIX)) { in wipeTestFiles() 53 Log.d(TAG, "Wiping " + file); in wipeTestFiles() 54 file.delete(); in wipeTestFiles() 141 private File buildApiObbPath(String file) { in buildApiObbPath() argument 142 return new File(getContext().getObbDir(), file); in buildApiObbPath() 145 private File buildEnvObbPath(String file) { in buildEnvObbPath() argument 146 return new File(new File(System.getenv("EXTERNAL_STORAGE"), "Android/obb"), file); in buildEnvObbPath() 149 private File buildRawObbPath(String file) { in buildRawObbPath() argument 150 return new File("/sdcard/Android/obb/", file); in buildRawObbPath() [all …]
|
/cts/suite/audio_quality/lib/src/audio/ |
D | Buffer.cpp | 91 std::ifstream file(filename.string(), std::ios::in | std::ios::binary | in loadFromFile() local 93 if (!file.is_open()) { in loadFromFile() 97 size_t size = file.tellg(); in loadFromFile() 102 file.seekg(0, std::ios::beg); in loadFromFile() 103 file.read(buffer->mData, size); //TODO handle read error in loadFromFile() 104 file.close(); in loadFromFile() 116 std::ofstream file(filenameWithExtension.string(), std::ios::out | std::ios::binary | in saveToFile() local 118 if (!file.is_open()) { in saveToFile() 123 file.write(mData, mSize); in saveToFile() 125 if (file.rdstate() != std::ios_base::goodbit) { in saveToFile() [all …]
|
/cts/tests/tests/net/src/android/net/cts/ |
D | VpnServiceTest.java | 112 File file = new File("/dev/tun"); in testTunDevice() local 113 assertTrue(file.exists()); in testTunDevice() 114 assertFalse(file.isFile()); in testTunDevice() 115 assertFalse(file.isDirectory()); in testTunDevice() 116 assertFalse(file.canExecute()); in testTunDevice() 117 assertFalse(file.canRead()); in testTunDevice() 118 assertFalse(file.canWrite()); in testTunDevice()
|
/cts/hostsidetests/theme/app/src/android/theme/app/ |
D | ThemeTestUtils.java | 34 public static boolean compressDirectory(File dir, File file) throws IOException { in compressDirectory() argument 35 if (dir == null || !dir.exists() || file == null || file.exists()) { in compressDirectory() 44 final ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(file)); in compressDirectory() 74 for (File file : files) { in deleteDirectory() 75 deleteDirectory(file); in deleteDirectory()
|
D | GenerateBitmapTask.java | 71 final File file = new File(mOutDir, mName + ".png"); in doInBackground() local 72 if (file.exists() && !file.canWrite()) { in doInBackground() 73 Log.e(TAG, "Unable to write file: " + file.getAbsolutePath()); in doInBackground() 81 stream = new FileOutputStream(file); in doInBackground()
|
/cts/libs/vogar-expect/src/vogar/commands/ |
D | Rm.java | 26 public void file(File file) { in file() method in Rm 27 new Command("rm", "-f", file.getPath()).execute(); in file()
|
/cts/tools/signature-tools/src/signature/io/impl/ |
D | BinaryApi.java | 40 File file = new File(directory, getFileName(api)); in externalizeApi() local 41 file.createNewFile(); in externalizeApi() 44 file)); in externalizeApi() 67 File file = new File(fileName); in loadApi() local 69 new FileInputStream(file)); in loadApi()
|
/cts/tests/tests/content/src/android/content/cts/ |
D | ReadableFileReceiverActivity.java | 68 for (File file : files) { in readFilesFromClipDataUri() 69 if (!testFileContents(file)) { in readFilesFromClipDataUri() 70 Log.e(TAG, "File contents of " + file.getPath() in readFilesFromClipDataUri() 107 private boolean testFileContents(File file) { in testFileContents() argument 110 FileReader reader = new FileReader(file); in testFileContents() 114 Log.e(TAG, "Error while reading file " + file.getPath() + "."); in testFileContents()
|
/cts/tests/tests/os/src/android/os/storage/cts/ |
D | StorageManagerTest.java | 167 private static void assertFileContains(File file, String contents) throws IOException { in assertFileContains() argument 168 byte[] actual = Streams.readFully(new FileInputStream(file)); in assertFileContains() 251 private String mountObb(final int resource, final File file, int expectedState) { in mountObb() argument 252 copyRawToFile(resource, file); in mountObb() 255 assertTrue("mountObb call on " + file.getPath() + " should succeed", in mountObb() 256 mStorageManager.mountObb(file.getPath(), null, observer)); in mountObb() 270 private ObbObserver mountObbWithoutWait(final int resource, final File file) { in mountObbWithoutWait() argument 271 copyRawToFile(resource, file); in mountObbWithoutWait() 274 assertTrue("mountObb call on " + file.getPath() + " should succeed", in mountObbWithoutWait() 275 mStorageManager.mountObb(file.getPath(), null, observer)); in mountObbWithoutWait() [all …]
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ |
D | ByodIconSamplerActivity.java | 66 FileOutputStream file = null; in sampleImage() local 68 file = new FileOutputStream(fileName); in sampleImage() 69 bitmap.compress(Bitmap.CompressFormat.PNG, 100, file); in sampleImage() 74 if (file != null) { in sampleImage() 75 file.close(); in sampleImage()
|
/cts/tests/tests/content/src/android/content/res/cts/ |
D | AssetFileDescriptor_AutoCloseOutputStreamTest.java | 55 File file = new File(getContext().getFilesDir(), FILE_NAME); in testAutoCloseOutputStream() local 56 file.createNewFile(); in testAutoCloseOutputStream() 57 ParcelFileDescriptor fd = ParcelFileDescriptor.open(file, in testAutoCloseOutputStream() 69 fd = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_WRITE); in testAutoCloseOutputStream()
|
/cts/tools/signature-tools/test/signature/converter/doclet/ |
D | DocletTestConverter.java | 88 File file = new File(directory, filename + ".java"); in putSource() local 89 File parent = file.getParentFile(); in putSource() 92 FileWriter wr = new FileWriter(file); in putSource() 98 File file = new File(sourcepath); in removeSources() local 99 removeFile(file); in removeSources() 102 private static void removeFile(File file){ in removeFile() argument 103 if(file.isDirectory()){ in removeFile() 104 for(File f : file.listFiles()) removeFile(f); in removeFile() 106 file.delete(); in removeFile()
|
/cts/suite/audio_quality/test/ |
D | BufferTest.cpp | 49 android::String8 file("/tmp/cts_audio_temp"); in TEST_F() local 50 ASSERT_TRUE(buffer->saveToFile(file)); in TEST_F() 51 file.append(".r2s"); in TEST_F() 52 UniquePtr<Buffer> bufferRead(Buffer::loadFromFile(file)); in TEST_F()
|
/cts/tests/tests/graphics/src/android/graphics/drawable/cts/ |
D | IconTest.java | 75 File file = new File(mActivity.getFilesDir(), "testimage.jpg"); in testFileIcon() local 77 writeSampleImage(file); in testFileIcon() 78 assertTrue(file.exists()); in testFileIcon() 80 checkIconValidity(Icon.createWithFilePath(file.getPath())); in testFileIcon() 82 checkIconValidity(Icon.createWithContentUri(Uri.fromFile(file))); in testFileIcon() 84 checkIconValidity(Icon.createWithContentUri(file.toURI().toString())); in testFileIcon() 86 file.delete(); in testFileIcon()
|
/cts/tests/tests/graphics/src/android/graphics/cts/ |
D | TypefaceTest.java | 145 File file = new File(obtainPath()); in testCreateFromFile1() local 146 Typeface typeface = Typeface.createFromFile(file); in testCreateFromFile1() 166 File file = new File(dir, "test.jpg"); in obtainPath() local 167 if (!file.createNewFile()) { in obtainPath() 168 if (!file.exists()) { in obtainPath() 173 FileOutputStream fOutput = new FileOutputStream(file); in obtainPath() 181 return (file.getPath()); in obtainPath()
|
/cts/hostsidetests/appsecurity/test-apps/ExternalStorageApp/src/com/android/cts/externalstorageapp/ |
D | CommonExternalStorageTest.java | 340 private static boolean isWhiteList(File file) { in isWhiteList() argument 344 if (file.getParentFile().getAbsolutePath().equals( in isWhiteList() 347 if (file.getName().equalsIgnoreCase(whiteList)) { in isWhiteList() 361 for (File file : files) { in removeWhiteList() 362 if (!isWhiteList(file)) { in removeWhiteList() 363 fileList.add(file); in removeWhiteList() 373 for (File file : files) { in deleteContents() 374 if (file.isDirectory()) { in deleteContents() 375 deleteContents(file); in deleteContents() 377 assertTrue(file.delete()); in deleteContents() [all …]
|
/cts/tools/dex-tools/ |
D | README.txt | 3 This project contains the source code and tests for a dex file parser. 4 The parser is able to read a dex file and to create a datastructure based on it. 8 Since this folder contains a .project file, it can be imported directly into eclipse as a java proj… 18 doc : dex file spec on which this parser is based
|
/cts/tests/tests/media/src/android/media/cts/ |
D | ScannerNotificationReceiver.java | 62 for (File file : files) { in countFiles() 63 if (file.isDirectory()) { in countFiles() 64 count += countFiles(file); in countFiles()
|
/cts/tests/tests/security/src/android/security/cts/ |
D | BannedFilesTest.java | 134 private static void assertNotSetugid(String file) { in assertNotSetugid() argument 136 if (!FileUtils.getFileStatus(file, fs, false)) { in assertNotSetugid() 139 assertTrue("File \"" + file + "\" is setUID", (fs.mode & FileUtils.S_ISUID) == 0); in assertNotSetugid() 140 assertTrue("File \"" + file + "\" is setGID", (fs.mode & FileUtils.S_ISGID) == 0); in assertNotSetugid()
|
D | LinuxRngTest.java | 40 public static native int getCharDeviceMajor(String file) throws IOException; in getCharDeviceMajor() argument 41 public static native int getCharDeviceMinor(String file) throws IOException; in getCharDeviceMinor() argument
|
/cts/suite/cts/deviceTests/filesystemperf/src/com/android/cts/filesystemperf/ |
D | FileUtil.java | 121 public static void writeFile(File file, byte[] data, boolean append) throws IOException { in writeFile() argument 122 final RandomAccessFile randomFile = new RandomAccessFile(file, "rwd"); // force O_SYNC in writeFile() 143 File file = createNewFile(context, dirName); in createNewFilledFile() local 144 FileOutputStream out = new FileOutputStream(file); in createNewFilledFile() 153 return file; in createNewFilledFile() 219 private static RWAmount getRWAmount(File file) throws IOException { in getRWAmount() argument 222 BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file))); in getRWAmount() 272 File file = FileUtil.createNewFilledFile(context, in doRandomReadTest() local 287 final RandomAccessFile randomFile = new RandomAccessFile(file, "rw"); // do not need O_SYNC in doRandomReadTest() 327 File file = FileUtil.createNewFilledFile(context, in doRandomWriteTest() local [all …]
|
/cts/libs/deviceutil/src/android/cts/util/ |
D | FileUtils.java | 103 public native static int setPermissions(String file, int mode); in setPermissions() argument 135 public static void createFile(File file, int numBytes) throws IOException { in createFile() argument 136 File parentFile = file.getParentFile(); in createFile() 141 FileOutputStream output = new FileOutputStream(file); in createFile()
|