X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/400a17d3e32952fbec63902084ff1d32ee346f4c..7f75f13f0c47b5cc4f5fe6a743a6fb8a9281fef7:/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 9f0c0dc5..d14151a2 100644 --- a/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java +++ b/src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java @@ -39,6 +39,7 @@ import eu.alefzero.owncloud.datamodel.FileDataStorageManager; import eu.alefzero.owncloud.datamodel.OCFile; import eu.alefzero.owncloud.files.services.FileDownloader; import eu.alefzero.webdav.WebdavEntry; +import eu.alefzero.webdav.WebdavUtils; /** * SyncAdapter implementation for syncing sample SyncAdapter contacts to the @@ -176,7 +177,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { .getModificationTimestamp()) { Intent intent = new Intent(this.getContext(), FileDownloader.class); intent.putExtra(FileDownloader.EXTRA_ACCOUNT, getAccount()); - intent.putExtra(FileDownloader.EXTRA_FILE_PATH, file.getURLDecodedRemotePath()); + intent.putExtra(FileDownloader.EXTRA_FILE_PATH, file.getRemotePath()); intent.putExtra(FileDownloader.EXTRA_REMOTE_PATH, file.getRemotePath()); intent.putExtra(FileDownloader.EXTRA_FILE_SIZE, file.getFileLength()); file.setKeepInSync(true); @@ -184,6 +185,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { } if (getStorageManager().getFileByPath(file.getRemotePath()) != null) file.setKeepInSync(getStorageManager().getFileByPath(file.getRemotePath()).keepInSync()); + //getStorageManager().saveFile(file); updatedFiles.add(file); if (parentId == 0) @@ -219,7 +221,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { for (int i=0; i < files.size() && !mCancellation; i++) { OCFile newFile = files.get(i); if (newFile.getMimetype().equals("DIR")) { - fetchData(getUri().toString() + newFile.getRemotePath(), syncResult, newFile.getFileId()); + fetchData(getUri().toString() + WebdavUtils.encodePath(newFile.getRemotePath()), syncResult, newFile.getFileId()); } } if (mCancellation) Log.d(TAG, "Leaving " + uri + " because cancellation request"); @@ -254,7 +256,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { } private OCFile fillOCFile(WebdavEntry we) { - OCFile file = new OCFile(we.path()); + OCFile file = new OCFile(we.decodedPath()); file.setCreationTimestamp(we.createTimestamp()); file.setFileLength(we.contentLength()); file.setMimetype(we.contentType());