fix(S3): make sure the build works
This commit is contained in:
parent
bc3c0adba5
commit
24e96b7205
@ -158,22 +158,12 @@ class S3Impl {
|
|||||||
throw new CloudNodeAlreadyExistsException(target.getName());
|
throw new CloudNodeAlreadyExistsException(target.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
// if (source instanceof S3Folder) {
|
||||||
if (source instanceof S3Folder) {
|
// return S3CloudNodeFactory.from(target.getParent(), client().moveFolder(source.getPath(), target.getPath()).execute());
|
||||||
return S3CloudNodeFactory.from(target.getParent(), client().moveFolder(source.getPath(), target.getPath()).execute());
|
// } else {
|
||||||
} else {
|
// return S3CloudNodeFactory.from(target.getParent(), client().moveFile(source.getPath(), target.getPath()).execute());
|
||||||
return S3CloudNodeFactory.from(target.getParent(), client().moveFile(source.getPath(), target.getPath()).execute());
|
// }
|
||||||
}
|
return null;
|
||||||
} catch (ApiError ex) {
|
|
||||||
if (PCloudApiError.isCloudNodeAlreadyExistsException(ex.errorCode())) {
|
|
||||||
throw new CloudNodeAlreadyExistsException(target.getName());
|
|
||||||
} else if (PCloudApiError.isNoSuchCloudFileException(ex.errorCode())) {
|
|
||||||
throw new NoSuchCloudFileException(source.getName());
|
|
||||||
} else {
|
|
||||||
handleApiError(ex, PCloudApiError.ignoreMoveSet, null);
|
|
||||||
}
|
|
||||||
throw new FatalBackendException(ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public S3File write(S3File file, DataSource data, final ProgressAware<UploadState> progressAware, boolean replace, long size) throws IOException, BackendException {
|
public S3File write(S3File file, DataSource data, final ProgressAware<UploadState> progressAware, boolean replace, long size) throws IOException, BackendException {
|
||||||
@ -307,32 +297,34 @@ class S3Impl {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleApiError(ApiError ex) throws BackendException {
|
//TODO: add proper error handling or remove entirely
|
||||||
handleApiError(ex, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleApiError(ApiError ex, String name) throws BackendException {
|
// private void handleApiError(ApiError ex) throws BackendException {
|
||||||
handleApiError(ex, null, name);
|
// handleApiError(ex, null, null);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private void handleApiError(ApiError ex, Set<Integer> errorCodes, String name) throws BackendException {
|
// private void handleApiError(ApiError ex, String name) throws BackendException {
|
||||||
if (errorCodes == null || !errorCodes.contains(ex.errorCode())) {
|
// handleApiError(ex, null, name);
|
||||||
int errorCode = ex.errorCode();
|
// }
|
||||||
if (PCloudApiError.isCloudNodeAlreadyExistsException(errorCode)) {
|
//
|
||||||
throw new CloudNodeAlreadyExistsException(name);
|
// private void handleApiError(ApiError ex, Set<Integer> errorCodes, String name) throws BackendException {
|
||||||
} else if (PCloudApiError.isForbiddenException(errorCode)) {
|
// if (errorCodes == null || !errorCodes.contains(ex.errorCode())) {
|
||||||
throw new ForbiddenException();
|
// int errorCode = ex.errorCode();
|
||||||
} else if (PCloudApiError.isNetworkConnectionException(errorCode)) {
|
// if (PCloudApiError.isCloudNodeAlreadyExistsException(errorCode)) {
|
||||||
throw new NetworkConnectionException(ex);
|
// throw new CloudNodeAlreadyExistsException(name);
|
||||||
} else if (PCloudApiError.isNoSuchCloudFileException(errorCode)) {
|
// } else if (PCloudApiError.isForbiddenException(errorCode)) {
|
||||||
throw new NoSuchCloudFileException(name);
|
// throw new ForbiddenException();
|
||||||
} else if (PCloudApiError.isWrongCredentialsException(errorCode)) {
|
// } else if (PCloudApiError.isNetworkConnectionException(errorCode)) {
|
||||||
throw new WrongCredentialsException(cloud);
|
// throw new NetworkConnectionException(ex);
|
||||||
} else if (PCloudApiError.isUnauthorizedException(errorCode)) {
|
// } else if (PCloudApiError.isNoSuchCloudFileException(errorCode)) {
|
||||||
throw new UnauthorizedException();
|
// throw new NoSuchCloudFileException(name);
|
||||||
} else {
|
// } else if (PCloudApiError.isWrongCredentialsException(errorCode)) {
|
||||||
throw new FatalBackendException(ex);
|
// throw new WrongCredentialsException(cloud);
|
||||||
}
|
// } else if (PCloudApiError.isUnauthorizedException(errorCode)) {
|
||||||
}
|
// throw new UnauthorizedException();
|
||||||
}
|
// } else {
|
||||||
|
// throw new FatalBackendException(ex);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user