validateCredentials();
} catch (NeutronInvalidCredentialsException e) {
throw new NeutronRestApiException("Invalid credentials!", e);
}
NeutronRestFactory factory = NeutronRestFactory.getInstance();
NeutronRestApi neutronRestApi = factory.getNeutronApi(PutMethod.class);
PutMethod putMethod = (PutMethod) neutronRestApi.createMethod(url, uri);
try {
String encodedCredentials = encodeCredentials();
putMethod.setRequestHeader("Authorization", "Basic " + encodedCredentials);