protected void onReleaseResources(List<File> data) { if (mFileObserver != null) { mFileObserver.stopWatching(); mFileObserver = null; } }
public void stopObservers() { synchronized (observers) { for (final FileObserver o : observers.values()) { o.stopWatching(); } observers.clear(); } }
/** Called when deinitializing component. */ protected void onDeinitialize() { super.onDeinitialize(); m_FileThread.quitSafely(); m_DecodeBitmapThread.quitSafely(); m_FileThread = null; m_FileHandler = null; m_FileList.clear(); m_FileObserver.stopWatching(); m_FileObserver = null; }
@Override public boolean deleteFile(String path, boolean notify) { File file = new File(path); boolean ret = false; if (!notify) { m_FileObserver.stopWatching(); ret = file.delete(); m_FileObserver.startWatching(); } else { ret = file.delete(); } Log.d(TAG, "deleteFile: " + ret + " path: " + path); return ret; }
public void a_() { if (B != null) { B.a(true); } if (I != null) { I.d(); I.c(); I = null; } O = true; if (aj) { com.estrongs.fs.a.b.a().b(Y); } if (W != null) { W.stopWatching(); } }
protected void a(com.estrongs.fs.h paramh, TypedMap paramTypedMap) { if ((w != null) && (w.equals(paramh)) && (!am.aW(w.getPath()))) {} while ((z.n) && (paramh != null) && (paramh.getPath().equals("/"))) { return; } if (W != null) { W.stopWatching(); W = null; } if ((!M) && (k(paramh.getAbsolutePath()))) {} for (;;) { synchronized (N) { if ((v != null) && (w != null) && ((N.isEmpty()) || (!am.e(paramh.getAbsolutePath(), w.getAbsolutePath())))) { N.push(w); TypedMap localTypedMap = new TypedMap(U); b.put(w, localTypedMap); } U.clear(); if (paramTypedMap != null) { U.putAll(paramTypedMap); } R(); if (v == null) { F.put(paramh.getPath(), g.onSaveInstanceState()); w = paramh; v = paramh.getPath(); if ((am.ba(v)) && (am.bW(v)) && (paramh.getName().equals("es_recycle_content"))) { w = com.estrongs.fs.d.m("recycle://"); v = "recycle://"; } if (am.ba(w.getAbsolutePath())) { W = new bz(this, w.getAbsolutePath()); W.startWatching(); } V = true; U.put("back", Boolean.valueOf(M)); if ((U == null) || (!U.getBoolean("refresh")) || (M)) { break; } b(true); return; } } if (ak) { F.put(v, null); ak = false; } else { F.put(v, g.onSaveInstanceState()); } } g(); }
void scanDir(final File dir) { // Checks if scan should be continued if (!inScan.get()) { return; } if (dir == null || !dir.isDirectory()) { return; } if (dir.getAbsolutePath().startsWith("/sys")) { LCTX.d("Skip system dir: " + dir); return; } try { final File cd = CacheManager.getCacheDir(); if (dir.getCanonicalPath().equals(cd.getCanonicalPath())) { LCTX.d("Skip file cache: " + dir); return; } } catch (final IOException ex) { ex.printStackTrace(); } if (LCTX.isDebugEnabled()) { LCTX.d("Scan dir: " + dir); } // Retrieves file observer for scanning folder final FileObserver observer = getObserver(dir); // Stop watching observer.stopWatching(); // Retrieves listener final Listener l = listeners.getListener(); // Retrieves file list final File[] files = dir.listFiles((FilenameFilter) filter); // Sort file list if (LengthUtils.isNotEmpty(files)) { Arrays.sort(files, StringUtils.NFC); } // Call the file scan callback l.onFileScan(dir, files); // Retrieves files from current directory final File[] childDirs = dir.listFiles(DirectoryFilter.ALL); // Immediately starts folder watching getObserver(dir).startWatching(); if (LengthUtils.isNotEmpty(childDirs)) { // Sort child dir list Arrays.sort(childDirs, StringUtils.NFC); // Add children for deep ordered scanning synchronized (this) { for (int i = childDirs.length - 1; i >= 0; i--) { this.paths.addFirst(childDirs[i]); } } } }
public void stop() { if (mFileObserver != null) { mFileObserver.stopWatching(); } }