X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/bf3cf8cdffa1f9debaaaef1da13c9b8c4b9c1bb0..5fc7cd13e7e561ef528e12d2fa088b58e35e00d0:/src/com/owncloud/android/operations/RemoteOperationResult.java diff --git a/src/com/owncloud/android/operations/RemoteOperationResult.java b/src/com/owncloud/android/operations/RemoteOperationResult.java index eb895ca1..0618b86d 100644 --- a/src/com/owncloud/android/operations/RemoteOperationResult.java +++ b/src/com/owncloud/android/operations/RemoteOperationResult.java @@ -25,7 +25,6 @@ import java.net.SocketTimeoutException; import java.net.UnknownHostException; import javax.net.ssl.SSLException; -import javax.net.ssl.SSLPeerUnverifiedException; import org.apache.commons.httpclient.ConnectTimeoutException; import org.apache.commons.httpclient.HttpException; @@ -58,7 +57,9 @@ public class RemoteOperationResult { NO_NETWORK_CONNECTION, SSL_ERROR, SSL_RECOVERABLE_PEER_UNVERIFIED, - BAD_OC_VERSION + BAD_OC_VERSION, + STORAGE_ERROR_MOVING_FROM_TMP, + CANCELLED } private boolean mSuccess = false; @@ -95,7 +96,10 @@ public class RemoteOperationResult { public RemoteOperationResult(Exception e) { mException = e; - if (e instanceof SocketException) { + if (e instanceof OperationCancelledException) { + mCode = ResultCode.CANCELLED; + + } else if (e instanceof SocketException) { mCode = ResultCode.WRONG_CONNECTION; } else if (e instanceof SocketTimeoutException) { @@ -133,6 +137,10 @@ public class RemoteOperationResult { return mSuccess; } + public boolean isCancelled() { + return mCode == ResultCode.CANCELLED; + } + public int getHttpCode() { return mHttpCode; } @@ -170,7 +178,10 @@ public class RemoteOperationResult { public String getLogMessage() { if (mException != null) { - if (mException instanceof SocketException) { + if (mException instanceof OperationCancelledException) { + return "Operation cancelled by the caller"; + + } else if (mException instanceof SocketException) { return "Socket exception"; } else if (mException instanceof SocketTimeoutException) { @@ -210,6 +221,9 @@ public class RemoteOperationResult { } 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"; } return "Operation finished with HTTP status code " + mHttpCode + " (" + (isSuccess()?"success":"fail") + ")";