X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/6c32365704be635c38e0a338b727643fa76120f5..b12ca42b45b69cee9e15de0abe5758f3d75f527e:/src/com/owncloud/android/files/OwnCloudFileObserver.java?ds=inline diff --git a/src/com/owncloud/android/files/OwnCloudFileObserver.java b/src/com/owncloud/android/files/OwnCloudFileObserver.java index bc528308..0093e7cf 100644 --- a/src/com/owncloud/android/files/OwnCloudFileObserver.java +++ b/src/com/owncloud/android/files/OwnCloudFileObserver.java @@ -18,6 +18,7 @@ package com.owncloud.android.files; +import java.io.File; import java.util.LinkedList; import java.util.List; @@ -39,16 +40,16 @@ import android.util.Log; public class OwnCloudFileObserver extends FileObserver { - public static int CHANGES_ONLY = CLOSE_WRITE | MOVED_FROM | MODIFY; + public static int CHANGES_ONLY = CLOSE_WRITE; - private static String TAG = "OwnCloudFileObserver"; + private static String TAG = OwnCloudFileObserver.class.getSimpleName(); private String mPath; private int mMask; - DataStorageManager mStorage; - Account mOCAccount; - OCFile mFile; - static Context mContext; - List mListeners; + private DataStorageManager mStorage; + private Account mOCAccount; + private OCFile mFile; + private Context mContext; + private List mListeners; public OwnCloudFileObserver(String path) { this(path, ALL_EVENTS); @@ -91,9 +92,9 @@ public class OwnCloudFileObserver extends FileObserver { @Override public void onEvent(int event, String path) { - Log.d(TAG, "Got file modified with event " + event + " and path " + path); + Log.d(TAG, "Got file modified with event " + event + " and path " + mPath + ((path != null) ? File.separator + path : "")); if ((event & mMask) == 0) { - Log.wtf(TAG, "Incorrect event " + event + " sent for file " + path + + Log.wtf(TAG, "Incorrect event " + event + " sent for file " + mPath + ((path != null) ? File.separator + path : "") + " with registered for " + mMask + " and original path " + mPath); for (FileObserverStatusListener l : mListeners) @@ -101,7 +102,7 @@ public class OwnCloudFileObserver extends FileObserver { return; } WebdavClient wc = OwnCloudClientUtils.createOwnCloudClient(mOCAccount, mContext); - SynchronizeFileOperation sfo = new SynchronizeFileOperation(mFile.getRemotePath(), mStorage, mOCAccount, mContext); + SynchronizeFileOperation sfo = new SynchronizeFileOperation(mFile.getRemotePath(), mStorage, mOCAccount); RemoteOperationResult result = sfo.execute(wc); if (result.getExtraData() == Boolean.TRUE) {