src/main/java/js/http/ContentType.java
public static ContentType forFile(File file) {
		Params.notNull(file, "File");
		ContentType contentType = FILE_TYPES.get(Files.getExtension(file));
		if (contentType == null) {
			log.debug("Unknown content type for |%s|. Replace with default |%s|.", file, TEXT_HTML);
			contentType = TEXT_HTML;
		}
		return contentType;
	}
public static ContentType forFile(File file) {
		Params.notNull(file, "File");
		ContentType contentType = FILE_TYPES.get(Files.getExtension(file));
		if (contentType == null) {
			log.debug("Unknown content type for |%s|. Replace with default |%s|.", file, TEXT_HTML);
			contentType = TEXT_HTML;
		}
		return contentType;
	}
public static ContentType forFile ( File file ) { Params . notNull ( file , "File" ) ; ContentType contentType = FILE_TYPES . get ( Files . getExtension ( file ) ) ; if ( contentType == null ) { log . debug ( "Unknown content type for |%s|. Replace with default |%s|." , file , TEXT_HTML ) ; contentType = TEXT_HTML ; } return contentType ; }
Create a content type instance suitable to represent requested file. It is a trivial a approach using a map of common
used file extension. Recognizes only couple, most used types; if extension is not recognized returns {@link #TEXT_HTML}.

@param file source file.
@return content type discovered for requested file.
@throws IllegalArgumentException if file parameter is null.
Create a content type instance suitable to represent requested file . It is a trivial a approach using a map of common used file extension . Recognizes only couple most used types ; if extension is not recognized returns { @link #TEXT_HTML } .