Loading app/src/main/java/foundation/e/drive/operations/UploadFileOperation.java +6 −0 Original line number Diff line number Diff line Loading @@ -85,10 +85,13 @@ public class UploadFileOperation extends RemoteOperation { return new RemoteOperationResult(ResultCode.SYNC_CONFLICT); } Double relativeQuotaBeforeFileUpload = 0.0; if (this.availableQuota == -1) { RemoteOperationResult checkQuotaResult = checkAvailableSpace(client, file.length()); if (checkQuotaResult.getCode() != ResultCode.OK) { return new RemoteOperationResult(checkQuotaResult.getCode()); }else{ relativeQuotaBeforeFileUpload = (Double) checkQuotaResult.getSingleData(); } } Loading Loading @@ -155,6 +158,7 @@ public class UploadFileOperation extends RemoteOperation { ArrayList<Object> datas = new ArrayList<>(); datas.add(syncedState.getSyncedFolderId()); datas.add(relativeQuotaBeforeFileUpload); final RemoteOperationResult finalResult = new RemoteOperationResult(resultCode); finalResult.setData(datas); return finalResult; Loading Loading @@ -194,6 +198,8 @@ public class UploadFileOperation extends RemoteOperation { return new RemoteOperationResult(ResultCode.QUOTA_EXCEEDED); } else { Log.d(TAG, "Quota Okay"); RemoteOperationResult result = new RemoteOperationResult(ResultCode.OK); result.setSingleData((Double) userInfo.getQuota().getRelative()); return new RemoteOperationResult(ResultCode.OK); } } else { Loading Loading
app/src/main/java/foundation/e/drive/operations/UploadFileOperation.java +6 −0 Original line number Diff line number Diff line Loading @@ -85,10 +85,13 @@ public class UploadFileOperation extends RemoteOperation { return new RemoteOperationResult(ResultCode.SYNC_CONFLICT); } Double relativeQuotaBeforeFileUpload = 0.0; if (this.availableQuota == -1) { RemoteOperationResult checkQuotaResult = checkAvailableSpace(client, file.length()); if (checkQuotaResult.getCode() != ResultCode.OK) { return new RemoteOperationResult(checkQuotaResult.getCode()); }else{ relativeQuotaBeforeFileUpload = (Double) checkQuotaResult.getSingleData(); } } Loading Loading @@ -155,6 +158,7 @@ public class UploadFileOperation extends RemoteOperation { ArrayList<Object> datas = new ArrayList<>(); datas.add(syncedState.getSyncedFolderId()); datas.add(relativeQuotaBeforeFileUpload); final RemoteOperationResult finalResult = new RemoteOperationResult(resultCode); finalResult.setData(datas); return finalResult; Loading Loading @@ -194,6 +198,8 @@ public class UploadFileOperation extends RemoteOperation { return new RemoteOperationResult(ResultCode.QUOTA_EXCEEDED); } else { Log.d(TAG, "Quota Okay"); RemoteOperationResult result = new RemoteOperationResult(ResultCode.OK); result.setSingleData((Double) userInfo.getQuota().getRelative()); return new RemoteOperationResult(ResultCode.OK); } } else { Loading