import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.OwnCloudClientFactory;
import com.owncloud.android.lib.common.OwnCloudCredentials;
+import com.owncloud.android.lib.common.network.RedirectionPath;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
// Client
Uri uri = Uri.parse(url);
OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, mContext, true);
-
client.setCredentials(credentials);
// Operation
);
result = operation.execute(client);
+ if (operation.wasRedirected()) {
+ RedirectionPath redirectionPath = operation.getRedirectionPath();
+ String permanentLocation = redirectionPath.getLastPermanentLocation();
+ result.setLastPermanentLocation(permanentLocation);
+ }
+
} else {
result = new RemoteOperationResult(RemoteOperationResult.ResultCode.UNKNOWN_ERROR);
}