public static void deleteDir(File f) { if (f.exists() && f.isDirectory()) { for (File file : f.listFiles()) { if (file.isDirectory()) deleteDir(file); file.delete(); } f.delete(); } } }
String key = FileUtils.getCanonical(new File(path)); if (mCaseInsensitivePaths) key = path.toLowerCase();
public static String getName(String uri) { String path = getPath(uri); if (path != null) return new File(path).getName(); return null; }
public void setDataSource(Context context, Uri uri) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException { if (context == null || uri == null) throw new IllegalArgumentException(); String scheme = uri.getScheme(); if (scheme == null || scheme.equals("file")) { setDataSource(FileUtils.getPath(uri.toString())); return; } try { ContentResolver resolver = context.getContentResolver(); mFD = resolver.openAssetFileDescriptor(uri, "r"); if (mFD == null) return; setDataSource(mFD.getParcelFileDescriptor().getFileDescriptor()); return; } catch (Exception e) { closeFD(); } Log.e("Couldn't open file on client side, trying server side %s", uri.toString()); setDataSource(uri.toString()); return; }
return; path = FileUtils.getCanonical(tempFile); String key = mCaseInsensitivePaths ? path.toLowerCase() : path; mFileCache.put(key, new FileCacheEntry(Video.Media.CONTENT_URI, rowId, path, lastModified));
public static void deleteDir(File f) { if (f.exists() && f.isDirectory()) { for (File file : f.listFiles()) { if (file.isDirectory()) deleteDir(file); file.delete(); } f.delete(); } } }
public void setDataSource(Context context, Uri uri, Map<String, String> headers) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException { if (context == null || uri == null) throw new IllegalArgumentException(); String scheme = uri.getScheme(); if (scheme == null || scheme.equals("file")) { setDataSource(FileUtils.getPath(uri.toString())); return; } try { ContentResolver resolver = context.getContentResolver(); mFD = resolver.openAssetFileDescriptor(uri, "r"); if (mFD == null) return; setDataSource(mFD.getParcelFileDescriptor().getFileDescriptor()); return; } catch (Exception e) { closeFD(); } setDataSource(uri.toString(), headers); }
String key = FileUtils.getCanonical(new File(path)); if (mCaseInsensitivePaths) key = path.toLowerCase();
public static void deleteDir(File f) { if (f.exists() && f.isDirectory()) { for (File file : f.listFiles()) { if (file.isDirectory()) deleteDir(file); file.delete(); } f.delete(); } } }
public static String getName(String uri) { String path = getPath(uri); if (path != null) return new File(path).getName(); return null; }
String key = FileUtils.getCanonical(new File(path)); if (mCaseInsensitivePaths) key = path.toLowerCase();
public static void deleteDir(File f) { if (f.exists() && f.isDirectory()) { for (File file : f.listFiles()) { if (file.isDirectory()) deleteDir(file); file.delete(); } f.delete(); } } }
public static String getName(String uri) { String path = getPath(uri); if (path != null) return new File(path).getName(); return null; }
String key = FileUtils.getCanonical(new File(path)); if (mCaseInsensitivePaths) key = path.toLowerCase();
public static void deleteDir(File f) { if (f.exists() && f.isDirectory()) { for (File file : f.listFiles()) { if (file.isDirectory()) deleteDir(file); file.delete(); } f.delete(); } } }
public static String getName(String uri) { String path = getPath(uri); if (path != null) return new File(path).getName(); return null; }
String key = FileUtils.getCanonical(new File(path)); if (mCaseInsensitivePaths) key = path.toLowerCase();
public static String getName(String uri) { String path = getPath(uri); if (path != null) return new File(path).getName(); return null; }
return; path = FileUtils.getCanonical(tempFile); String key = mCaseInsensitivePaths ? path.toLowerCase() : path; mFileCache.put(key, new FileCacheEntry(Video.Media.CONTENT_URI, rowId, path, lastModified));
public void setDataSource(Context context, Uri uri) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException { if (context == null || uri == null) throw new IllegalArgumentException(); String scheme = uri.getScheme(); if (scheme == null || scheme.equals("file")) { setDataSource(FileUtils.getPath(uri.toString())); return; } try { ContentResolver resolver = context.getContentResolver(); mFD = resolver.openAssetFileDescriptor(uri, "r"); if (mFD == null) return; setDataSource(mFD.getParcelFileDescriptor().getFileDescriptor()); return; } catch (Exception e) { closeFD(); } Log.e("Couldn't open file on client side, trying server side %s", uri.toString()); setDataSource(uri.toString()); return; }