Home | History | Annotate | Download | only in util

Lines Matching refs:File

5  * you may not use this file except in compliance with the License.
19 import java.io.File;
36 * File utilities
53 * @return The file representing the projects root directory, {@code null} if the external
56 public static File getProjectsRootDir(Context context)
58 final File dir = context.getExternalFilesDir(null);
63 // Create the file which hides the media files
64 if (!new File(dir, ".nomedia").createNewFile()) {
65 throw new FileNotFoundException("Cannot create file .nomedia");
74 * Get the filename for the specified raw resource id. Create the file if
75 * the file does not exist.
101 final File mf = new File(context.getFilesDir(), filename);
137 * Get the raw id for the mask file
139 * @param path The full file name
144 final String filename = new File(path).getName();
151 throw new IllegalArgumentException("Unknown file: " + path);
156 * Get the filename for the specified raw resource id. Create the file if
157 * the file does not exist
193 final File mf = new File(context.getFilesDir(), filename);
227 final File file = new File(getProjectsRootDir(context), StringUtils.randomString(10));
229 Log.d(TAG, "New project: " + file.getAbsolutePath());
232 return file.getAbsolutePath();
238 * @param fileType The file type
256 throw new IllegalArgumentException("Unsupported file type: " + fileType);
260 final File moviesDirectory = Environment.getExternalStoragePublicDirectory(
267 final File f = new File(moviesDirectory, filename);
276 public static boolean deleteDir(File dir) {
280 final File f = new File(dir, children[i]);
282 Log.e(TAG, "File cannot be deleted: " + f.getAbsolutePath());
293 * Get the name of the file
296 * @return The name of the file