- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
import android.database.Cursor;
import android.os.Binder;
import android.os.IBinder;
import android.database.Cursor;
import android.os.Binder;
import android.os.IBinder;
super.onDestroy();
unregisterReceiver(mDownloadReceiver);
mObserversMap = null; // TODO study carefully the life cycle of Services to grant the best possible observance
super.onDestroy();
unregisterReceiver(mDownloadReceiver);
mObserversMap = null; // TODO study carefully the life cycle of Services to grant the best possible observance
ProviderTableMeta.FILE_KEEP_IN_SYNC + " = ?",
new String[] {String.valueOf(1)},
null);
ProviderTableMeta.FILE_KEEP_IN_SYNC + " = ?",
new String[] {String.valueOf(1)},
null);
OwnCloudFileObserver observer =
new OwnCloudFileObserver( path,
OwnCloudFileObserver observer =
new OwnCloudFileObserver( path,
account,
getApplicationContext(),
OwnCloudFileObserver.CHANGES_ONLY);
mObserversMap.put(path, observer);
if (new File(path).exists()) {
observer.startWatching();
account,
getApplicationContext(),
OwnCloudFileObserver.CHANGES_ONLY);
mObserversMap.put(path, observer);
if (new File(path).exists()) {
observer.startWatching();
OwnCloudFileObserver observer = mObserversMap.get(localPath);
if (observer == null) {
/// the local file was never registered to observe before
OwnCloudFileObserver observer = mObserversMap.get(localPath);
if (observer == null) {
/// the local file was never registered to observe before
account,
getApplicationContext(),
OwnCloudFileObserver.CHANGES_ONLY);
mObserversMap.put(localPath, observer);
account,
getApplicationContext(),
OwnCloudFileObserver.CHANGES_ONLY);
mObserversMap.put(localPath, observer);
OwnCloudFileObserver observer = mObserversMap.get(downloadPath);
if (observer != null) {
if (intent.getAction().equals(FileDownloader.DOWNLOAD_FINISH_MESSAGE) &&
OwnCloudFileObserver observer = mObserversMap.get(downloadPath);
if (observer != null) {
if (intent.getAction().equals(FileDownloader.DOWNLOAD_FINISH_MESSAGE) &&
- new File(downloadPath).exists()) { // the download could be successful, or not; in both cases, the file could be down, due to a former download or upload
+ new File(downloadPath).exists()) { // the download could be successful. not; in both cases, the file could be down, due to a former download or upload