X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/a2a8dc1ee6681d641a4316dccaacca6751c32a6a..fdb9149e0e0047299bf986006db4a6b0a10f0947:/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java diff --git a/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java b/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java index 816e79ee..63e99d59 100644 --- a/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java +++ b/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java @@ -31,8 +31,8 @@ import android.content.ContentProviderClient; import android.content.Context; 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 +45,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 +61,21 @@ 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); + Log.d("ASD", "syncing owncloud account " + 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 +95,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); }