X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/d25af7eea587e0112d3baeac6faf3c8321439aae..8361540852ec87b51c85937e0f326a83e19cd8ad:/src/com/owncloud/android/operations/RemoteOperationResult.java?ds=sidebyside diff --git a/src/com/owncloud/android/operations/RemoteOperationResult.java b/src/com/owncloud/android/operations/RemoteOperationResult.java index 60b2b1a1..cae45699 100644 --- a/src/com/owncloud/android/operations/RemoteOperationResult.java +++ b/src/com/owncloud/android/operations/RemoteOperationResult.java @@ -44,8 +44,8 @@ import com.owncloud.android.network.CertificateCombinedException; */ public class RemoteOperationResult implements Serializable { - /** Generated - to refresh every time the class changes */ - private static final long serialVersionUID = -7805531062432602444L; + /** Generated - should be refreshed every time the class changes!! */ + private static final long serialVersionUID = 5336333154035462033L; public enum ResultCode { @@ -65,14 +65,21 @@ public class RemoteOperationResult implements Serializable { SSL_ERROR, SSL_RECOVERABLE_PEER_UNVERIFIED, BAD_OC_VERSION, - STORAGE_ERROR_MOVING_FROM_TMP, - CANCELLED + CANCELLED, + INVALID_LOCAL_FILE_NAME, + INVALID_OVERWRITE, + CONFLICT, + SYNC_CONFLICT, + LOCAL_STORAGE_FULL, + LOCAL_STORAGE_NOT_MOVED, + LOCAL_STORAGE_NOT_COPIED } private boolean mSuccess = false; private int mHttpCode = -1; private Exception mException = null; private ResultCode mCode = ResultCode.UNKNOWN_ERROR; + private Object mExtraData = null; public RemoteOperationResult(ResultCode code) { mCode = code; @@ -97,6 +104,9 @@ public class RemoteOperationResult implements Serializable { case HttpStatus.SC_INTERNAL_SERVER_ERROR: mCode = ResultCode.INSTANCE_NOT_CONFIGURED; break; + case HttpStatus.SC_CONFLICT: + mCode = ResultCode.CONFLICT; + break; default: mCode = ResultCode.UNHANDLED_HTTP_CODE; } @@ -167,6 +177,14 @@ public class RemoteOperationResult implements Serializable { return mCode == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED; } + public void setExtraData(Object data) { + mExtraData = data; + } + + public Object getExtraData() { + return mExtraData; + } + private CertificateCombinedException getCertificateCombinedException(Exception e) { CertificateCombinedException result = null; if (e instanceof CertificateCombinedException) { @@ -238,8 +256,11 @@ public class RemoteOperationResult implements Serializable { } else if (mCode == ResultCode.BAD_OC_VERSION) { return "No valid ownCloud version was found at the server"; - } else if (mCode == ResultCode.STORAGE_ERROR_MOVING_FROM_TMP) { - return "Error while moving file from temporal to final directory"; + } else if (mCode == ResultCode.LOCAL_STORAGE_FULL) { + return "Local storage full"; + + } else if (mCode == ResultCode.LOCAL_STORAGE_NOT_MOVED) { + return "Error while moving file to final directory"; } return "Operation finished with HTTP status code " + mHttpCode + " (" + (isSuccess()?"success":"fail") + ")";