X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/a2a8dc1ee6681d641a4316dccaacca6751c32a6a..fae44486b9545bfb2a49ded9a0c3fd550fd18549:/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java?ds=sidebyside diff --git a/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java b/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java index 816e79ee..a97d59d1 100644 --- a/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java +++ b/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java @@ -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); }