1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Added changes requested in PR

This commit is contained in:
davigonz 2017-02-07 08:53:14 +01:00
parent 12e7af8af5
commit 626e2f0efa
2 changed files with 3 additions and 2 deletions

View File

@ -254,7 +254,7 @@ public class RemoteOperationResult implements Serializable {
ErrorMessageParser xmlParser = new ErrorMessageParser();
try {
String errorMessage = xmlParser.parseXMLResponse(is);
if (errorMessage != "" && errorMessage != null) {
if (errorMessage != null && errorMessage != "") {
mCode = ResultCode.SPECIFIC_FORBIDDEN;
mHttpPhrase = errorMessage;
}

View File

@ -57,6 +57,7 @@ import com.owncloud.android.lib.common.utils.Log_OC;
public class DownloadRemoteFileOperation extends RemoteOperation {
private static final String TAG = DownloadRemoteFileOperation.class.getSimpleName();
private static final int FORBIDDEN_ERROR = 403;
private Set<OnDatatransferProgressListener> mDataTransferListeners = new HashSet<OnDatatransferProgressListener>();
private final AtomicBoolean mCancellationRequested = new AtomicBoolean(false);
@ -161,7 +162,7 @@ public class DownloadRemoteFileOperation extends RemoteOperation {
// TODO some kind of error control!
}
} else if (status != 403){
} else if (status != FORBIDDEN_ERROR){
client.exhaustResponse(mGet.getResponseBodyAsStream());
} // else, body read by RemoteOeprationResult constructor