|
@@ -33,6 +33,7 @@ import android.content.Intent;
|
|
|
import android.content.SyncResult;
|
|
|
import android.content.IntentSender.SendIntentException;
|
|
|
import android.os.Bundle;
|
|
|
+import android.util.Log;
|
|
|
import eu.alefzero.owncloud.datamodel.FileDataStorageManager;
|
|
|
import eu.alefzero.owncloud.datamodel.OCFile;
|
|
|
import eu.alefzero.webdav.WebdavEntry;
|
|
@@ -45,10 +46,6 @@ import eu.alefzero.webdav.WebdavEntry;
|
|
|
*/
|
|
|
public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
|
|
|
|
|
|
- public static final String SYNC_MESSAGE = "eu.alefzero.owncloud.files.ACCOUNT_SYNC";
|
|
|
- public static final String IN_PROGRESS = "sync_in_progress";
|
|
|
- public static final String ACCOUNT_NAME = "account_name";
|
|
|
-
|
|
|
public FileSyncAdapter(Context context, boolean autoInitialize) {
|
|
|
super(context, autoInitialize);
|
|
|
}
|
|
@@ -65,17 +62,19 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
|
|
|
this.setContentProvider(provider);
|
|
|
this.setStorageManager(new FileDataStorageManager(account, getContentProvider()));
|
|
|
|
|
|
- Intent i = new Intent(SYNC_MESSAGE);
|
|
|
- i.putExtra(IN_PROGRESS, true);
|
|
|
- i.putExtra("ACCOUNT_NAME", account.name);
|
|
|
+ Intent i = new Intent(FileSyncService.SYNC_MESSAGE);
|
|
|
+ i.putExtra(FileSyncService.IN_PROGRESS, true);
|
|
|
+ i.putExtra(FileSyncService.ACCOUNT_NAME, account.name);
|
|
|
getContext().sendStickyBroadcast(i);
|
|
|
|
|
|
PropFindMethod query;
|
|
|
try {
|
|
|
- query = new PropFindMethod(getUri().toString());
|
|
|
+ Log.e("ASD", getUri().toString());
|
|
|
+ query = new PropFindMethod(getUri().toString()+"/");
|
|
|
getClient().executeMethod(query);
|
|
|
MultiStatus resp = null;
|
|
|
resp = query.getResponseBodyAsMultiStatus();
|
|
|
+
|
|
|
if (resp.getResponses().length > 0) {
|
|
|
WebdavEntry we = new WebdavEntry(resp.getResponses()[0]);
|
|
|
OCFile file = fillOCFile(we);
|
|
@@ -95,7 +94,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
|
|
|
syncResult.stats.numIoExceptions++;
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- i.putExtra(IN_PROGRESS, false);
|
|
|
+ i.putExtra(FileSyncService.IN_PROGRESS, false);
|
|
|
getContext().sendStickyBroadcast(i);
|
|
|
}
|
|
|
|