public class Authentication10ResponseHandler implements ResponseHandler<AuthenticationResponse> {
public AuthenticationResponse handleResponse(final HttpResponse response) throws ClientProtocolException, IOException {
if(response.getStatusLine().getStatusCode() == 200 || response.getStatusLine().getStatusCode() == 203
|| response.getStatusLine().getStatusCode() == 204) {
return new AuthenticationResponse(response, response.getFirstHeader(Constants.X_AUTH_TOKEN).getValue(),
Collections.singleton(new Region(null,
this.getStorageURL(response), this.getCDNManagementURL(response), true)));
}
else if(response.getStatusLine().getStatusCode() == 401 || response.getStatusLine().getStatusCode() == 403) {
throw new AuthorizationException(new Response(response));