public static void setContentTypeHeader ( HttpResponse response , File file ) { String mimeType = MimeTypes . getMimeTypeForFileName ( file . getName ( ) ) ; String mimeFinal = mimeType != null ? mimeType : MimeTypes . getDefaultMimeType ( ) ; response . headers ( ) . set ( CONTENT_TYPE , mimeFinal ) ; }
Sets the content type header for the HTTP Response .