Reply error = request.makeReply(HTTP.UNSUPPORTED_MEDIA_TYPE) ;
error.setContent ("<p>Invalid content type: "+type.toString());
throw new HTTPException (error) ;
}
}
ImageFileResource ifresource = (ImageFileResource) fresource;
// Write the body back to the file:
try {
// We are about to accept the put, notify client before continuing
Client client = request.getClient();
if ( client != null && request.getExpect() != null ) {
client.sendContinue();
}
if ( ifresource.newMetadataContent(request.getInputStream()) )
status = HTTP.CREATED;
else
status = HTTP.NO_CONTENT;
} catch (IOException ex) {
throw new ClientException(request.getClient(), ex);