/packages/apps/UnifiedEmail/src/org/apache/commons/io/ |
D | FileUtils.java | 131 public static FileInputStream openInputStream(File file) throws IOException { in openInputStream() argument 132 if (file.exists()) { in openInputStream() 133 if (file.isDirectory()) { in openInputStream() 134 throw new IOException("File '" + file + "' exists but is a directory"); in openInputStream() 136 if (file.canRead() == false) { in openInputStream() 137 throw new IOException("File '" + file + "' cannot be read"); in openInputStream() 140 throw new FileNotFoundException("File '" + file + "' does not exist"); in openInputStream() 142 return new FileInputStream(file); in openInputStream() 166 public static FileOutputStream openOutputStream(File file) throws IOException { in openOutputStream() argument 167 if (file.exists()) { in openOutputStream() [all …]
|
D | DirectoryWalker.java | 393 …protected final void checkIfCancelled(File file, int depth, Collection results) throws IOException… in checkIfCancelled() argument 394 if (handleIsCancelled(file, depth, results)) { in checkIfCancelled() 395 throw new CancelException(file, depth); in checkIfCancelled() 435 File file, int depth, Collection results) throws IOException { in handleIsCancelled() argument 517 protected void handleFile(File file, int depth, Collection results) throws IOException { in handleFile() argument 572 private File file; field in DirectoryWalker.CancelException 583 public CancelException(File file, int depth) { in CancelException() argument 584 this("Operation Cancelled", file, depth); in CancelException() 596 public CancelException(String message, File file, int depth) { in CancelException() argument 598 this.file = file; in CancelException() [all …]
|
/packages/apps/DocumentsUI/tests/common/com/android/documentsui/ |
D | StubProvider.java | 127 final File file = new File(getContext().getCacheDir(), rootId); in clearCacheAndBuildRoots() local 128 if (file.mkdir()) { in clearCacheAndBuildRoots() 129 Log.i(TAG, "Created new root directory @ " + file.getPath()); in clearCacheAndBuildRoots() 131 final RootInfo rootInfo = new RootInfo(file, getSize(rootId)); in clearCacheAndBuildRoots() 174 final StubDocument file = mStorage.get(documentId); in queryDocument() local 175 if (file == null) { in queryDocument() 178 includeDocument(result, file); in queryDocument() 186 return FileUtils.contains(parentDocument.file, childDocument.file); in isChildDocument() 193 File file = createFile(parent, mimeType, displayName); in createDocument() local 195 final StubDocument document = StubDocument.createRegularDocument(file, mimeType, parent); in createDocument() [all …]
|
/packages/services/Car/tools/emulator/ |
D | vhal_const_generate.py | 32 print("# Copyright (C) %s The Android Open Source Project" % year, file=dest) 33 print("#", file=dest) 34 print("# Licensed under the Apache License, Version 2.0 (the \"License\");", file=dest) 35 print("# you may not use this file except in compliance with the License.", file=dest) 36 print("# You may obtain a copy of the License at", file=dest) 37 print("#", file=dest) 38 print("# http://www.apache.org/licenses/LICENSE-2.0", file=dest) 39 print("#", file=dest) 40 print("# Unless required by applicable law or agreed to in writing, software", file=dest) 41 print("# distributed under the License is distributed on an \"AS IS\" BASIS,", file=dest) [all …]
|
/packages/services/Car/tests/BugReportApp/utils/ |
D | bugreport_app_tester.py | 387 def _is_image(self, file): argument 389 ext = file.name.split('.')[-1] 392 def _validate_image(self, file): argument 393 if file.compress_size == 0: 394 return _red('[Invalid] Image %s is empty.' % file.name) 395 return file.name + ' (%d kb)' % (file.compress_size / 1024) 397 def _is_audio(self, file): argument 399 return file.name.endswith('.3gp') 401 def _validate_audio(self, file): argument 403 if file.compress_size == 0: [all …]
|
/packages/apps/UnifiedEmail/src/org/apache/commons/io/output/ |
D | LockableFileWriter.java | 107 public LockableFileWriter(File file) throws IOException { in LockableFileWriter() argument 108 this(file, false, null); in LockableFileWriter() 119 public LockableFileWriter(File file, boolean append) throws IOException { in LockableFileWriter() argument 120 this(file, append, null); in LockableFileWriter() 132 public LockableFileWriter(File file, boolean append, String lockDir) throws IOException { in LockableFileWriter() argument 133 this(file, null, append, lockDir); in LockableFileWriter() 144 public LockableFileWriter(File file, String encoding) throws IOException { in LockableFileWriter() argument 145 this(file, encoding, false, null); in LockableFileWriter() 158 public LockableFileWriter(File file, String encoding, boolean append, in LockableFileWriter() argument 162 file = file.getAbsoluteFile(); in LockableFileWriter() [all …]
|
D | FileWriterWithEncoding.java | 140 public FileWriterWithEncoding(File file, String encoding) throws IOException { in FileWriterWithEncoding() argument 141 this(file, encoding, false); in FileWriterWithEncoding() 153 public FileWriterWithEncoding(File file, String encoding, boolean append) throws IOException { in FileWriterWithEncoding() argument 155 this.out = initWriter(file, encoding, append); in FileWriterWithEncoding() 166 public FileWriterWithEncoding(File file, Charset encoding) throws IOException { in FileWriterWithEncoding() argument 167 this(file, encoding, false); in FileWriterWithEncoding() 179 public FileWriterWithEncoding(File file, Charset encoding, boolean append) throws IOException { in FileWriterWithEncoding() argument 181 this.out = initWriter(file, encoding, append); in FileWriterWithEncoding() 192 public FileWriterWithEncoding(File file, CharsetEncoder encoding) throws IOException { in FileWriterWithEncoding() argument 193 this(file, encoding, false); in FileWriterWithEncoding() [all …]
|
/packages/providers/MediaProvider/src/com/android/providers/media/scan/ |
D | ModernMediaScanner.java | 89 import java.nio.file.FileVisitResult; 90 import java.nio.file.FileVisitor; 91 import java.nio.file.Files; 92 import java.nio.file.Path; 93 import java.nio.file.attribute.BasicFileAttributes; 164 public void scanDirectory(File file) { in scanDirectory() argument 165 try (Scan scan = new Scan(file)) { in scanDirectory() 172 public Uri scanFile(File file) { in scanFile() argument 173 try (Scan scan = new Scan(file)) { in scanFile() 365 public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) in visitFile() argument [all …]
|
D | PlaylistResolver.java | 45 import java.nio.file.Path; 65 final File file; in resolvePlaylist() local 73 file = new File(cursor.getString(1)); in resolvePlaylist() 81 return resolvePlaylistM3u(resolver, uri, file); in resolvePlaylist() 83 return resolvePlaylistPls(resolver, uri, file); in resolvePlaylist() 86 return resolvePlaylistWpl(resolver, uri, file); in resolvePlaylist() 93 @NonNull ContentResolver resolver, @NonNull Uri uri, @NonNull File file) in resolvePlaylistM3u() argument 95 final Path parentPath = file.getParentFile().toPath(); in resolvePlaylistM3u() 99 new InputStreamReader(new FileInputStream(file)))) { in resolvePlaylistM3u() 116 @NonNull ContentResolver resolver, @NonNull Uri uri, @NonNull File file) in resolvePlaylistPls() argument [all …]
|
/packages/services/Car/tools/ |
D | update-obd2-sensors.py | 218 print(policy.sensors(intSensors), file=destfile) 222 print(policy.sensors(floatSensors), file=destfile) 243 print("}", file=intfile) 244 print("}", file=floatfile) 251 print("#!/usr/bin/env python3", file=destfile) 252 print("#", file=destfile) 253 print("# Copyright (C) 2017 The Android Open Source Project", file=destfile) 254 print("#", file=destfile) 255 print("# Licensed under the Apache License, Version 2.0 (the \"License\");", file=destfile) 256 print("# you may not use this file except in compliance with the License.", file=destfile) [all …]
|
/packages/apps/DevCamera/src/com/android/devcamera/ |
D | MediaSaver.java | 63 File file; in saveDepth() local 66 file = new File(filename); in saveDepth() 67 if (!file.createNewFile()) { in saveDepth() 72 FileOutputStream fos = new FileOutputStream(file); in saveDepth() 90 bytesWritten, file, (t1 - t0) * 0.001)); in saveDepth() 104 File file; in saveJpeg() local 108 file = new File(filename); in saveJpeg() 109 if (file.createNewFile()) { in saveJpeg() 115 OutputStream os = new FileOutputStream(file); in saveJpeg() 124 insertImage(resolver, file); in saveJpeg() [all …]
|
/packages/providers/ContactsProvider/src/com/android/providers/contacts/ |
D | PhotoStore.java | 91 for (File file : files) { in clear() 92 cleanupFile(file); in clear() 124 for (File file : files) { in initialize() 126 Entry entry = new Entry(file); in initialize() 130 cleanupFile(file); in initialize() 195 File file = null; in insert() local 199 file = File.createTempFile("img", null, mStorePath); in insert() 200 FileOutputStream fos = new FileOutputStream(file); in insert() 213 if (file.renameTo(target)) { in insert() 224 if (file != null) { in insert() [all …]
|
/packages/apps/Car/SystemUpdater/src/com/android/car/systemupdater/ |
D | DeviceListFragment.java | 56 file -> !file.isHidden() && (file.isDirectory() 57 || file.getName().toLowerCase().endsWith(UPDATE_FILE_SUFFIX)); 178 private void onFileSelected(File file) { in onFileSelected() argument 179 if (isUpdateFile(file)) { in onFileSelected() 181 mSystemUpdater.applyUpdate(file); in onFileSelected() 182 } else if (file.isDirectory()) { in onFileSelected() 183 showFolderContent(file); in onFileSelected() 184 mFileStack.push(file); in onFileSelected() 221 protected File[] doInBackground(File... file) { in showFolderContent() argument 222 return file[0].listFiles(UPDATE_FILE_FILTER); in showFolderContent() [all …]
|
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/ |
D | FileCache.java | 79 for (File file : rootDir.listFiles()) { in deleteFiles() 80 String name = file.getName(); in deleteFiles() 81 if (file.isFile() && name.startsWith(FILE_PREFIX) in deleteFiles() 82 && name.endsWith(FILE_POSTFIX)) file.delete(); in deleteFiles() 100 public void store(String downloadUrl, File file) { in store() argument 103 Utils.assertTrue(file.getParentFile().equals(mRootDir)); in store() 107 entry.filename = file.getName(); in store() 108 entry.size = file.length(); in store() 111 file.delete(); in store() 117 file.delete(); in store() [all …]
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/makedict/ |
D | BinaryDictDecoderEncoderTests.java | 160 private static long timeWritingDictToFile(final File file, final FusionDictionary dict, in timeWritingDictToFile() argument 166 final DictEncoder dictEncoder = BinaryDictUtils.getDictEncoder(file, formatOptions); in timeWritingDictToFile() 213 private static long timeReadingAndCheckDict(final File file, final List<String> words, in timeReadingAndCheckDict() argument 219 final DictDecoder dictDecoder = BinaryDictIOUtils.getDictDecoder(file, 0, file.length(), in timeReadingAndCheckDict() 242 final File file = BinaryDictUtils.getDictFile(dictName, dictVersion, formatOptions, in runReadAndWrite() local 251 final long write = timeWritingDictToFile(file, dict, formatOptions); in runReadAndWrite() 252 final long read = timeReadingAndCheckDict(file, words, bigrams, bufferType); in runReadAndWrite() 284 final File file = BinaryDictUtils.getDictFile(dictName, dictVersion, in testCharacterTableIsPresent() local 288 final DictEncoder dictEncoder = new Ver2DictEncoder(file, in testCharacterTableIsPresent() 299 final DictDecoder dictDecoder = BinaryDictIOUtils.getDictDecoder(file, 0, file.length(), in testCharacterTableIsPresent() [all …]
|
D | DictDecoder.java | 129 public DictBuffer getDictionaryBuffer(final File file) in getDictionaryBuffer() argument 143 public DictBuffer getDictionaryBuffer(final File file) in getDictionaryBuffer() argument 148 inStream = new FileInputStream(file); in getDictionaryBuffer() 150 0, file.length()); in getDictionaryBuffer() 172 public DictBuffer getDictionaryBuffer(final File file) in getDictionaryBuffer() argument 176 inStream = new FileInputStream(file); in getDictionaryBuffer() 177 final byte[] array = new byte[(int) file.length()]; in getDictionaryBuffer() 199 public DictBuffer getDictionaryBuffer(final File file) in getDictionaryBuffer() argument 204 raFile = new RandomAccessFile(file, "rw"); in getDictionaryBuffer() 205 buffer = raFile.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, file.length()); in getDictionaryBuffer()
|
/packages/providers/DownloadProvider/src/com/android/providers/downloads/ |
D | Helpers.java | 239 final File file = new File(Uri.parse(hint).getPath()); in generateSaveFile() local 240 parent = file.getParentFile().getAbsoluteFile(); in generateSaveFile() 242 name = file.getName(); in generateSaveFile() 293 final File file = new File(parent, name); in generateSaveFile() 294 file.createNewFile(); in generateSaveFile() 295 return file.getAbsolutePath(); in generateSaveFile() 497 static boolean isFilenameValid(Context context, File file) { in isFilenameValid() argument 498 return isFilenameValid(context, file, true); in isFilenameValid() 501 static boolean isFilenameValidInExternal(Context context, File file) { in isFilenameValidInExternal() argument 502 return isFilenameValid(context, file, false); in isFilenameValidInExternal() [all …]
|
/packages/inputmethods/LatinIME/native/jni/src/dictionary/utils/ |
D | dict_file_writing_utils.cpp | 90 /* static */ bool DictFileWritingUtils::writeBufferToFileTail(FILE *const file, in writeBufferToFileTail() argument 96 if (fwrite(bufferSize, SIZE_OF_BUFFER_SIZE_FIELD, 1 /* count */, file) < 1) { in writeBufferToFileTail() 99 return writeBufferToFile(file, buffer); in writeBufferToFileTail() 110 FILE *const file = fdopen(fd, "wb"); in flushBufferToFile() local 111 if (!file) { in flushBufferToFile() 116 if (!writeBufferToFile(file, buffer)) { in flushBufferToFile() 117 fclose(file); in flushBufferToFile() 124 fclose(file); in flushBufferToFile() 129 /* static */ bool DictFileWritingUtils::writeBufferToFile(FILE *const file, in writeBufferToFile() argument 133 originalBufSize, 1, file) < 1) { in writeBufferToFile() [all …]
|
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/tools/ |
D | SaveImage.java | 214 for (File file : auxFiles) { in deleteAuxFiles() 215 file.delete(); in deleteAuxFiles() 237 public boolean putPanoramaXMPData(File file, Object xmp) { in putPanoramaXMPData() argument 239 return XmpUtilHelper.writeXMPMeta(file.getAbsolutePath(), xmp); in putPanoramaXMPData() 266 public boolean putExifData(File file, ExifInterface exif, Bitmap image, in putExifData() argument 271 s = exif.getExifWriterStream(file.getAbsolutePath()); in putExifData() 279 Log.w(LOGTAG, "File not found: " + file.getAbsolutePath(), e); in putExifData() 531 File file = new File(saveDirectory, filename + ".JPG"); in makeAndInsertUri() local 532 return linkNewFileToUri(context, sourceUri, file, time, false); in makeAndInsertUri() 583 File file = getLocalFileFromUri(context, sourceUri); in getSaveDirectory() local [all …]
|
/packages/apps/TV/tuner/src/com/android/tv/tuner/source/ |
D | TsStreamWriter.java | 159 for (File file : mDirectory.listFiles()) { in deleteOutdatedFiles() 160 if (file.isFile() in deleteOutdatedFiles() 161 && getFileId(file) == mInstanceId in deleteOutdatedFiles() 162 && (deleteAll || !mFileName.equals(file.getName()))) { in deleteOutdatedFiles() 163 boolean deleted = file.delete(); in deleteOutdatedFiles() 165 Log.w(TAG, "Failed to delete " + file.getName()); in deleteOutdatedFiles() 205 for (File file : mDirectory.listFiles()) { in getExistingIds() 206 int id = getFileId(file); in getExistingIds() 220 private static int getFileId(File file) { in getFileId() argument 221 if (file == null || !file.isFile()) { in getFileId() [all …]
|
/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/ |
D | FileSystemWriteTest.java | 38 File file = new File("/data/misc/bluetooth/test.file"); in testBluetoothDirWrite() local 39 Assert.assertTrue("File not created", file.createNewFile()); in testBluetoothDirWrite() 40 file.delete(); in testBluetoothDirWrite() 49 File file = new File("/data/misc/bluedroid/test.file"); in testBluedroidDirWrite() local 50 Assert.assertTrue("File not created", file.createNewFile()); in testBluedroidDirWrite() 51 file.delete(); in testBluedroidDirWrite() 60 File file = new File("/data/misc/bluetooth/logs/test.file"); in testBluetoothLogsDirWrite() local 61 Assert.assertTrue("File not created", file.createNewFile()); in testBluetoothLogsDirWrite() 62 file.delete(); in testBluetoothLogsDirWrite()
|
/packages/apps/Messaging/src/com/android/messaging/util/ |
D | FileUtil.java | 83 for (File file : root.listFiles()) { in removeFileOrDirectoryExcept() 84 if (exclude == null || !file.equals(exclude)) { in removeFileOrDirectoryExcept() 85 removeFileOrDirectoryExcept(file, exclude); in removeFileOrDirectoryExcept() 105 for (File file : sourceDir.listFiles()) { in moveAllContentUnderDirectory() 106 if (file.isDirectory()) { in moveAllContentUnderDirectory() 107 final File dirTarget = new File(targetDir, file.getName()); in moveAllContentUnderDirectory() 109 moveAllContentUnderDirectory(file, dirTarget); in moveAllContentUnderDirectory() 112 final File fileTarget = new File(targetDir, file.getName()); in moveAllContentUnderDirectory() 113 Files.move(file, fileTarget); in moveAllContentUnderDirectory() 134 final File file = new File(uri.getPath()); in isInPrivateDir() local [all …]
|
/packages/providers/MediaProvider/tests/src/com/android/providers/media/ |
D | IsoInterfaceTest.java | 43 final File file = stageFile(R.raw.test_video); in testRepeated() local 44 final IsoInterface mp4 = IsoInterface.fromFile(file); in testRepeated() 56 final File file = stageFile(R.raw.test_video_gps); in testGps() local 57 final IsoInterface mp4 = IsoInterface.fromFile(file); in testGps() 67 final File file = stageFile(R.raw.test_video_xmp); in testXmp() local 68 final IsoInterface mp4 = IsoInterface.fromFile(file); in testXmp() 79 final File file = File.createTempFile("test", ".mp4"); in stageFile() local 81 OutputStream out = new FileOutputStream(file)) { in stageFile() 84 return file; in stageFile()
|
/packages/services/Telephony/src/com/android/phone/ |
D | CallTime.java | 199 File file = PhoneGlobals.getInstance().getDir ("phoneTrace", Context.MODE_PRIVATE); in startTrace() local 200 if (file.exists() == false) { in startTrace() 201 file.mkdirs(); in startTrace() 203 String baseName = file.getPath() + File.separator + "callstate"; in startTrace() 207 file = new File(dataFile); in startTrace() 208 if (file.exists() == true) { in startTrace() 209 file.delete(); in startTrace() 212 file = new File(keyFile); in startTrace() 213 if (file.exists() == true) { in startTrace() 214 file.delete(); in startTrace()
|
/packages/apps/StorageManager/src/com/android/storagemanager/deletionhelper/ |
D | DownloadsDeletionType.java | 132 for (File file : data.files) { in onLoadFinished() 133 mFiles.add(file); in onLoadFinished() 166 public void setFileChecked(File file, boolean checked) { in setFileChecked() argument 168 mUncheckedFiles.remove(file.getPath()); in setFileChecked() 170 mUncheckedFiles.add(file.getPath()); in setFileChecked() 177 for (File file : mFiles) { in getFreeableBytes() 178 if (isChecked(file) || countUnchecked) { in getFreeableBytes() 179 freedBytes += file.length(); in getFreeableBytes() 198 public boolean isChecked(File file) { in isChecked() argument 199 return !mUncheckedFiles.contains(file.getPath()); in isChecked()
|