Loading src/com/owncloud/android/lib/resources/files/CreateRemoteFolderOperation.java +9 −6 Original line number Diff line number Diff line Loading @@ -28,12 +28,11 @@ import org.apache.jackrabbit.webdav.client.methods.MkColMethod; import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.network.WebdavUtils; import com.owncloud.android.lib.common.operations.InvalidCharacterExceptionParser; import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.status.OwnCloudVersion; /** Loading @@ -58,7 +57,8 @@ public class CreateRemoteFolderOperation extends RemoteOperation { * Constructor * * @param remotePath Full path to the new directory to create in the remote server. * @param createFullPath 'True' means that all the ancestor folders should be created if don't exist yet. * @param createFullPath 'True' means that all the ancestor folders should be created * if don't exist yet. */ public CreateRemoteFolderOperation(String remotePath, boolean createFullPath) { mRemotePath = remotePath; Loading @@ -73,8 +73,10 @@ public class CreateRemoteFolderOperation extends RemoteOperation { @Override protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result = null; boolean noInvalidChars = FileUtils.isValidPath(mRemotePath, client.getOwnCloudVersion().isVersionWithForbiddenCharacters()); OwnCloudVersion version = client.getOwnCloudVersion(); boolean versionWithForbiddenChars = (version != null && version.isVersionWithForbiddenCharacters()); boolean noInvalidChars = FileUtils.isValidPath(mRemotePath, versionWithForbiddenChars); if (noInvalidChars) { result = createFolder(client); if (!result.isSuccess() && mCreateFullPath && Loading Loading @@ -105,7 +107,8 @@ public class CreateRemoteFolderOperation extends RemoteOperation { Log_OC.d(TAG, mkcol.getResponseBodyAsString()); } else { result = new RemoteOperationResult(mkcol.succeeded(), status, mkcol.getResponseHeaders()); result = new RemoteOperationResult(mkcol.succeeded(), status, mkcol.getResponseHeaders()); Log_OC.d(TAG, "Create directory " + mRemotePath + ": " + result.getLogMessage()); } client.exhaustResponse(mkcol.getResponseBodyAsStream()); Loading Loading
src/com/owncloud/android/lib/resources/files/CreateRemoteFolderOperation.java +9 −6 Original line number Diff line number Diff line Loading @@ -28,12 +28,11 @@ import org.apache.jackrabbit.webdav.client.methods.MkColMethod; import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.network.WebdavUtils; import com.owncloud.android.lib.common.operations.InvalidCharacterExceptionParser; import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.common.utils.Log_OC; import com.owncloud.android.lib.resources.status.OwnCloudVersion; /** Loading @@ -58,7 +57,8 @@ public class CreateRemoteFolderOperation extends RemoteOperation { * Constructor * * @param remotePath Full path to the new directory to create in the remote server. * @param createFullPath 'True' means that all the ancestor folders should be created if don't exist yet. * @param createFullPath 'True' means that all the ancestor folders should be created * if don't exist yet. */ public CreateRemoteFolderOperation(String remotePath, boolean createFullPath) { mRemotePath = remotePath; Loading @@ -73,8 +73,10 @@ public class CreateRemoteFolderOperation extends RemoteOperation { @Override protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result = null; boolean noInvalidChars = FileUtils.isValidPath(mRemotePath, client.getOwnCloudVersion().isVersionWithForbiddenCharacters()); OwnCloudVersion version = client.getOwnCloudVersion(); boolean versionWithForbiddenChars = (version != null && version.isVersionWithForbiddenCharacters()); boolean noInvalidChars = FileUtils.isValidPath(mRemotePath, versionWithForbiddenChars); if (noInvalidChars) { result = createFolder(client); if (!result.isSuccess() && mCreateFullPath && Loading Loading @@ -105,7 +107,8 @@ public class CreateRemoteFolderOperation extends RemoteOperation { Log_OC.d(TAG, mkcol.getResponseBodyAsString()); } else { result = new RemoteOperationResult(mkcol.succeeded(), status, mkcol.getResponseHeaders()); result = new RemoteOperationResult(mkcol.succeeded(), status, mkcol.getResponseHeaders()); Log_OC.d(TAG, "Create directory " + mRemotePath + ": " + result.getLogMessage()); } client.exhaustResponse(mkcol.getResponseBodyAsStream()); Loading