Home
last modified time | relevance | path

Searched refs:file (Results 1 – 25 of 278) sorted by relevance

12345678910>>...12

/packages/apps/UnifiedEmail/src/org/apache/commons/io/
DFileUtils.java131 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 …]
DDirectoryWalker.java393 …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/UnifiedEmail/src/org/apache/commons/io/output/
DLockableFileWriter.java107 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 …]
DFileWriterWithEncoding.java140 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/DownloadProvider/src/com/android/providers/downloads/
DStorageUtils.java157 return (int) (lhs.file.lastModified() - rhs.file.lastModified()); in freeCacheStorage()
162 for (ConcreteFile file : files) { in freeCacheStorage()
165 if (now - file.file.lastModified() < MIN_DELETE_AGE) { in freeCacheStorage()
166 Slog.d(TAG, "Skipping recently modified " + file.file); in freeCacheStorage()
168 final long len = file.file.length(); in freeCacheStorage()
169 Slog.d(TAG, "Deleting " + file.file + " to reclaim " + len); in freeCacheStorage()
171 file.file.delete(); in freeCacheStorage()
189 private static long getDeviceId(File file) { in getDeviceId() argument
191 return Os.stat(file.getAbsolutePath()).st_dev; in getDeviceId()
221 final ConcreteFile file = new ConcreteFile(child); in listFilesRecursive() local
[all …]
DHelpers.java209 final File file = new File(Uri.parse(hint).getPath()); in generateSaveFile() local
210 parent = file.getParentFile().getAbsoluteFile(); in generateSaveFile()
212 name = file.getName(); in generateSaveFile()
263 final File file = new File(parent, name); in generateSaveFile()
264 file.createNewFile(); in generateSaveFile()
265 return file.getAbsolutePath(); in generateSaveFile()
463 static boolean isFilenameValid(Context context, File file) { in isFilenameValid() argument
464 return isFilenameValid(context, file, true); in isFilenameValid()
467 static boolean isFilenameValidInExternal(Context context, File file) { in isFilenameValidInExternal() argument
468 return isFilenameValid(context, file, false); in isFilenameValidInExternal()
[all …]
DDownloadIdleService.java163 final File file = new File(path); in cleanOrphans() local
165 fromDb.add(new ConcreteFile(file)); in cleanOrphans()
168 final String state = Environment.getExternalStorageState(file); in cleanOrphans()
176 Slog.d(TAG, "Missing " + file + ", deleting " + id); in cleanOrphans()
197 for (ConcreteFile file : fromDisk) { in cleanOrphans()
198 if (!fromDb.contains(file)) { in cleanOrphans()
199 Slog.d(TAG, "Missing db entry, deleting " + file.file); in cleanOrphans()
200 file.file.delete(); in cleanOrphans()
/packages/providers/ContactsProvider/src/com/android/providers/contacts/
DPhotoStore.java90 for (File file : files) { in clear()
91 cleanupFile(file); in clear()
123 for (File file : files) { in initialize()
125 Entry entry = new Entry(file); in initialize()
129 cleanupFile(file); in initialize()
194 File file = null; in insert() local
198 file = File.createTempFile("img", null, mStorePath); in insert()
199 FileOutputStream fos = new FileOutputStream(file); in insert()
212 if (file.renameTo(target)) { in insert()
223 if (file != null) { in insert()
[all …]
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/
DFileCache.java79 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/apps/DevCamera/src/com/android/devcamera/
DMediaSaver.java61 File file; in saveJpeg() local
65 file = new File(filename); in saveJpeg()
66 if (file.createNewFile()) { in saveJpeg()
72 OutputStream os = new FileOutputStream(file); in saveJpeg()
81 insertImage(resolver, file); in saveJpeg()
86 jpegData.length, file, (t1 - t0) * 0.001, (t2 - t1) * 0.001) ); in saveJpeg()
95 public static void insertImage(ContentResolver cr, File file) { in insertImage() argument
98 values.put(MediaStore.Images.Media.TITLE, file.getName()); in insertImage()
99 values.put(MediaStore.Images.Media.DISPLAY_NAME, file.getName()); in insertImage()
100 values.put(MediaStore.Images.Media.DESCRIPTION, file.getName()); in insertImage()
[all …]
/packages/inputmethods/LatinIME/native/jni/src/dictionary/utils/
Ddict_file_writing_utils.cpp90 /* 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/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/makedict/
DDictDecoder.java129 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/apps/Messaging/src/com/android/messaging/util/
DFileUtil.java83 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/services/Car/car_product/sepolicy/
Dqcom-post-boot.te17 allow qcom-post-boot shell_exec:file r_file_perms;
21 allow qcom-post-boot sysfs_thermal:file w_file_perms;
25 allow qcom-post-boot sysfs_rpm_resources:file w_file_perms;
29 allow qcom-post-boot sysfs_mpdecision:file { rw_file_perms setattr };
33 allow qcom-post-boot sysfs_dcvs:file { rw_file_perms setattr };
37 allow qcom-post-boot sysfs_bt_power:file { getattr setattr };
40 allow qcom-post-boot sysfs_devices_system_cpu:file { w_file_perms setattr };
43 allow qcom-post-boot sysfs:file { w_file_perms setattr };
48 allow qcom-post-boot sysfs:file r_file_perms;
50 allow qcom-post-boot toolbox_exec:file rx_file_perms;
Dqcom-usb-sh.te9 allow qcom-usb-sh sysfs_hsic_modem_wait:file { getattr setattr };
13 allow qcom-usb-sh sysfs:file relabelfrom;
14 allow qcom-usb-sh sysfs_hsic_modem_wait:file relabelto;
21 allow qcom-usb-sh sysfs_usb:file w_file_perms;
25 allow qcom-usb-sh shell_exec:file r_file_perms;
27 allow qcom-usb-sh toolbox_exec:file rx_file_perms;
29 allow qcom-usb-sh rootfs:file r_file_perms;
Dmpdecision.te18 allow mpdecision sysfs_devices_system_cpu:file rw_file_perms;
22 allow mpdecision sysfs_thermal:file r_file_perms;
26 allow mpdecision perfd_data_file:file create_file_perms;
30 allow mpdecision sysfs:file write;
34 allow mpdecision sysfs:file r_file_perms;
36 allow mpdecision proc:file rw_file_perms;
/packages/services/Telephony/src/com/android/phone/
DCallTime.java198 File file = PhoneGlobals.getInstance().getDir ("phoneTrace", Context.MODE_PRIVATE); in startTrace() local
199 if (file.exists() == false) { in startTrace()
200 file.mkdirs(); in startTrace()
202 String baseName = file.getPath() + File.separator + "callstate"; in startTrace()
206 file = new File(dataFile); in startTrace()
207 if (file.exists() == true) { in startTrace()
208 file.delete(); in startTrace()
211 file = new File(keyFile); in startTrace()
212 if (file.exists() == true) { in startTrace()
213 file.delete(); in startTrace()
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/tools/
DSaveImage.java214 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/inputmethods/LatinIME/native/jni/src/dictionary/structure/v4/
Dver4_dict_buffers.cpp119 FILE *const file = fdopen(fd, "wb"); in flushHeaderAndDictBuffers() local
120 if (!file) { in flushHeaderAndDictBuffers()
126 if (!flushDictBuffers(file)) { in flushHeaderAndDictBuffers()
127 fclose(file); in flushHeaderAndDictBuffers()
130 fclose(file); in flushHeaderAndDictBuffers()
146 bool Ver4DictBuffers::flushDictBuffers(FILE *const file) const { in flushDictBuffers()
148 if (!DictFileWritingUtils::writeBufferToFileTail(file, &mExpandableTrieBuffer)) { in flushDictBuffers()
153 if (!mTerminalPositionLookupTable.flushToFile(file)) { in flushDictBuffers()
158 if (!mLanguageModelDictContent.save(file)) { in flushDictBuffers()
163 if (!mShortcutDictContent.flushToFile(file)) { in flushDictBuffers()
/packages/apps/UnifiedEmail/src/org/apache/james/mime4j/util/
DSimpleTempStorage.java188 private File file = null; field in SimpleTempStorage.SimpleTempFile
190 private SimpleTempFile(File file) { in SimpleTempFile() argument
191 this.file = file; in SimpleTempFile()
192 this.file.deleteOnExit(); in SimpleTempFile()
199 return new BufferedInputStream(new FileInputStream(file)); in getInputStream()
206 return new BufferedOutputStream(new FileOutputStream(file)); in getOutputStream()
213 return file.getAbsolutePath(); in getAbsolutePath()
234 return file.length(); in length()
/packages/providers/ContactsProvider/src/com/android/providers/contacts/debug/
DDataExporter.java119 private static void removeFileOrDirectory(File file) { in removeFileOrDirectory() argument
120 if (!file.exists()) return; in removeFileOrDirectory()
122 if (file.isFile()) { in removeFileOrDirectory()
123 Log.i(TAG, "Removing " + file); in removeFileOrDirectory()
124 file.delete(); in removeFileOrDirectory()
128 if (file.isDirectory()) { in removeFileOrDirectory()
129 for (File child : file.listFiles()) { in removeFileOrDirectory()
132 Log.i(TAG, "Removing " + file); in removeFileOrDirectory()
133 file.delete(); in removeFileOrDirectory()
/packages/apps/ContactsCommon/src/com/android/contacts/common/vcard/
DShareVCardActivity.java49 final File file = getLocalFile(); in onServiceConnected() local
51 file.createNewFile(); in onServiceConnected()
59 getString(R.string.contacts_file_provider_authority), file); in onServiceConnected()
78 for (File file : getCacheDir().listFiles()) { in clearExportFiles()
79 final long ageInMillis = System.currentTimeMillis() - file.lastModified(); in clearExportFiles()
80 if (file.getName().startsWith(EXPORT_FILE_PREFIX) && ageInMillis > A_DAY_IN_MILLIS) { in clearExportFiles()
81 file.delete(); in clearExportFiles()
/packages/providers/MediaProvider/src/com/android/providers/media/
DMediaUpgradeReceiver.java64 String file = files[i]; in onReceive() local
65 if (MediaProvider.isMediaDatabaseName(file)) { in onReceive()
67 Slog.i(TAG, "---> Start upgrade of media database " + file); in onReceive()
71 context, file, MediaProvider.isInternalMediaDatabaseName(file), in onReceive()
75 Log.wtf(TAG, "Error during upgrade of media db " + file, t); in onReceive()
81 Slog.i(TAG, "<--- Finished upgrade of media database " + file in onReceive()
/packages/apps/CertInstaller/src/com/android/certinstaller/
DUtil.java80 static byte[] readFile(File file) { in readFile() argument
82 byte[] data = new byte[(int) file.length()]; in readFile()
83 FileInputStream fis = new FileInputStream(file); in readFile()
93 static boolean deleteFile(File file) { in deleteFile() argument
94 if ((file != null) && !file.delete()) { in deleteFile()
95 Log.w(TAG, "cannot delete cert: " + file); in deleteFile()
/packages/apps/Gallery2/src/com/android/gallery3d/data/
DDownloadCache.java96 File file = new File(cursor.getString(QUERY_INDEX_DATA)); in findEntryInDatabase() local
102 entry = new Entry(id, file); in findEntryInDatabase()
188 private synchronized long insertEntry(String url, File file) { in insertEntry() argument
189 long size = file.length(); in insertEntry()
194 values.put(Columns.DATA, file.getAbsolutePath()); in insertEntry()
235 for (File file : mRoot.listFiles()) { in onCreate()
236 if (!file.delete()) { in onCreate()
237 Log.w(TAG, "fail to remove: " + file.getAbsolutePath()); in onCreate()
287 File file = future.get(); in onFutureDone() local
289 if (file != null) { // insert to database in onFutureDone()
[all …]

12345678910>>...12