-
- OwnCloudFileObserver observer = mObserversMap.get(localPath);
- if (observer == null) {
- observer = new OwnCloudFileObserver(
- localPath, account, getApplicationContext()
- );
- mObserversMap.put(localPath, observer);
-
- // only if being added
- if (new File(localPath).exists()) {
- observer.startWatching();
- Log_OC.d(TAG, "Started watching file " + localPath);
- }
- }
-
- /*
- String parentPath = (new File(localPath)).getParent();
- OwnCloudFileObserver observerParent =
- new OwnCloudFileObserver( parentPath,
- account,
- getApplicationContext());
- mObserverParentsMap.put(parentPath, observer);
-
- if (new File(localPath).exists()) {
- observer.startWatching();
- Log_OC.d(TAG, "Started watching file " + localPath);
- observerParent.startWatching();
- Log_OC.d(TAG, "Started watching parent file " + parentPath);
- }
- */