if (statusCode == HttpStatus.SC_FORBIDDEN) {
throw new RemoteAccessDeniedException(repository, methodUri.toASCIIString(),
httpResponse.getStatusLine().getReasonPhrase());
}
else if (statusCode == HttpStatus.SC_UNAUTHORIZED) {
throw new RemoteAuthenticationNeededException(repository,
httpResponse.getStatusLine().getReasonPhrase());
}
else if (statusCode == HttpStatus.SC_OK && proxyReturnedError) {
throw new RemoteStorageException(
"Invalid artifact found, most likely a proxy redirected to an HTML error page.");