error.setContent("partial PUT not supported.");
throw new HTTPException(error);
}
// Check that if some type is provided it doesn't conflict:
if ( request.hasContentType() ) {
MimeType rtype = request.getContentType() ;
MimeType type = getCommentType() ;
if ( type == null ) {
setValue (ATTR_CONTENT_TYPE, rtype) ;
} else if ( rtype.match (type) < 0 ) {
if (debug) {
System.out.println("No match between: ["+
rtype.toString()+"] and ["+
type.toString()+"]");
}
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: