/** * Performs the operation * * @param client Client object to communicate with the remote ownCloud server. */ @Override protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result; result = createFolder(client); if (!result.isSuccess() && mCreateFullPath && RemoteOperationResult.ResultCode.CONFLICT == result.getCode()) { result = createParentFolder(FileUtils.getParentPath(mRemotePath), client); if (result.isSuccess()) { result = createFolder(client); // second (and last) try } } return result; }
/** * Performs the operation * * @param client Client object to communicate with the remote ownCloud server. */ @Override protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result; 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 && RemoteOperationResult.ResultCode.CONFLICT == result.getCode()) { result = createParentFolder(FileUtils.getParentPath(mRemotePath), client); if (result.isSuccess()) { result = createFolder(client); // second (and last) try } } } else { result = new RemoteOperationResult<>(ResultCode.INVALID_CHARACTER_IN_NAME); } return result; }