X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/2d8300d8347267c1e4e12f8d7518fdc6205dd795..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 133e5fc1..63e99d59 100644 --- a/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java +++ b/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java @@ -29,8 +29,10 @@ import android.accounts.AuthenticatorException; import android.accounts.OperationCanceledException; import android.content.ContentProviderClient; import android.content.Context; +import android.content.Intent; import android.content.SyncResult; 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; @@ -59,12 +61,21 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { this.setContentProvider(provider); this.setStorageManager(new FileDataStorageManager(account, getContentProvider())); + 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); @@ -84,7 +95,8 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { syncResult.stats.numIoExceptions++; e.printStackTrace(); } - + i.putExtra(FileSyncService.IN_PROGRESS, false); + getContext().sendStickyBroadcast(i); } private void fetchData(String uri, SyncResult syncResult, long parentId) {