Adapted ownCloud app to changes in ownCloud library interface

This commit is contained in:
David A. Velasco 2014-01-29 17:36:44 +01:00
parent 2bf9af5683
commit 3a02de8c90
4 changed files with 8 additions and 7 deletions

@ -1 +1 @@
Subproject commit 5b4f63ebdb365c6e7e9a3e0148aa18a8d5fb5067 Subproject commit afb4ae1c2e15dfc3b3f9a9861b75d375e38f2805

View file

@ -605,7 +605,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mCurrentUpload.getRemotePath()); ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mCurrentUpload.getRemotePath());
RemoteOperationResult result = operation.execute(mUploadClient); RemoteOperationResult result = operation.execute(mUploadClient);
if (result.isSuccess()) { if (result.isSuccess()) {
updateOCFile(file, result.getData().get(0)); updateOCFile(file, (RemoteFile)result.getData().get(0));
file.setLastSyncDateForProperties(syncDate); file.setLastSyncDateForProperties(syncDate);
} }

View file

@ -23,6 +23,7 @@ import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader; import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.files.services.FileUploader; import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.lib.network.OwnCloudClient; import com.owncloud.android.lib.network.OwnCloudClient;
import com.owncloud.android.lib.operations.common.RemoteFile;
import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.operations.common.RemoteOperation;
import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.operations.common.RemoteOperationResult;
import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode;
@ -89,7 +90,7 @@ public class SynchronizeFileOperation extends RemoteOperation {
ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath); ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath);
result = operation.execute(client); result = operation.execute(client);
if (result.isSuccess()){ if (result.isSuccess()){
mServerFile = FileStorageUtils.fillOCFile(result.getData().get(0)); mServerFile = FileStorageUtils.fillOCFile((RemoteFile)result.getData().get(0));
mServerFile.setLastSyncDateForProperties(System.currentTimeMillis()); mServerFile.setLastSyncDateForProperties(System.currentTimeMillis());
} }
} }

View file

@ -192,7 +192,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath); ReadRemoteFileOperation operation = new ReadRemoteFileOperation(remotePath);
result = operation.execute(client); result = operation.execute(client);
if (result.isSuccess()){ if (result.isSuccess()){
OCFile remoteFolder = FileStorageUtils.fillOCFile(result.getData().get(0)); OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile)result.getData().get(0));
// check if remote and local folder are different // check if remote and local folder are different
mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag())); mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
@ -256,12 +256,12 @@ public class SynchronizeFolderOperation extends RemoteOperation {
* retrieved. * retrieved.
* @return 'True' when any change was made in the local data, 'false' otherwise. * @return 'True' when any change was made in the local data, 'false' otherwise.
*/ */
private void synchronizeData(ArrayList<RemoteFile> folderAndFiles, OwnCloudClient client) { private void synchronizeData(ArrayList<Object> folderAndFiles, OwnCloudClient client) {
// get 'fresh data' from the database // get 'fresh data' from the database
mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath()); mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath());
// parse data from remote folder // parse data from remote folder
OCFile remoteFolder = fillOCFile(folderAndFiles.get(0)); OCFile remoteFolder = fillOCFile((RemoteFile)folderAndFiles.get(0));
remoteFolder.setParentId(mLocalFolder.getParentId()); remoteFolder.setParentId(mLocalFolder.getParentId());
remoteFolder.setFileId(mLocalFolder.getFileId()); remoteFolder.setFileId(mLocalFolder.getFileId());
@ -281,7 +281,7 @@ public class SynchronizeFolderOperation extends RemoteOperation {
OCFile remoteFile = null, localFile = null; OCFile remoteFile = null, localFile = null;
for (int i=1; i<folderAndFiles.size(); i++) { for (int i=1; i<folderAndFiles.size(); i++) {
/// new OCFile instance with the data from the server /// new OCFile instance with the data from the server
remoteFile = fillOCFile(folderAndFiles.get(i)); remoteFile = fillOCFile((RemoteFile)folderAndFiles.get(i));
remoteFile.setParentId(mLocalFolder.getFileId()); remoteFile.setParentId(mLocalFolder.getFileId());
/// retrieve local data for the read file /// retrieve local data for the read file