if(credential != null) {
request.setAuthorization(credential);
}
try {
Reply reply = http.runRequest(request);
MimeType type = reply.getContentType();
if( reply.getStatus() == HTTP.UNAUTHORIZED) {
getInputStream(reply).close();
throw new RemoteAccessException("Unauthorized");
}
if ((type == null) || (type.match(conftype) < 0)) {
String content = getContent(reply);
if (content != null)
throw new RemoteAccessException(content);
throw new RemoteAccessException("invalid content type");
}