- // / new PROPFIND to keep data consistent with server in theory, should
- // return the same we already have
- PropFindMethod propfind = null;
- RemoteOperationResult result = null;
- try {
- propfind = new PropFindMethod(mUploadClient.getBaseUri() + WebdavUtils.encodePath(mCurrentUpload.getRemotePath()),
- DavConstants.PROPFIND_ALL_PROP,
- DavConstants.DEPTH_0);
- int status = mUploadClient.executeMethod(propfind);
- boolean isMultiStatus = (status == HttpStatus.SC_MULTI_STATUS);
- if (isMultiStatus) {
- MultiStatus resp = propfind.getResponseBodyAsMultiStatus();
- WebdavEntry we = new WebdavEntry(resp.getResponses()[0], mUploadClient.getBaseUri().getPath());
- updateOCFile(file, we);
- file.setLastSyncDateForProperties(syncDate);
-
- } else {
- mUploadClient.exhaustResponse(propfind.getResponseBodyAsStream());
- }
-
- result = new RemoteOperationResult(isMultiStatus, status, propfind.getResponseHeaders());
- Log_OC.i(TAG, "Update: synchronizing properties for uploaded " + mCurrentUpload.getRemotePath() + ": "
- + result.getLogMessage());
-
- } catch (Exception e) {
- result = new RemoteOperationResult(e);
- Log_OC.e(TAG, "Update: synchronizing properties for uploaded " + mCurrentUpload.getRemotePath() + ": "
- + result.getLogMessage(), e);
-
- } finally {
- if (propfind != null)
- propfind.releaseConnection();
+ // new PROPFIND to keep data consistent with server
+ // in theory, should return the same we already have
+ ReadRemoteFileOperation operation = new ReadRemoteFileOperation(mCurrentUpload.getRemotePath());
+ RemoteOperationResult result = operation.execute(mUploadClient);
+ if (result.isSuccess()) {
+ updateOCFile(file, (RemoteFile) result.getData().get(0));
+ file.setLastSyncDateForProperties(syncDate);