jooby/src/main/java/org/jooby/MediaType.java
/**
   * Get a {@link MediaType} for a file extension.
   *
   * @param ext A file extension, like <code>js</code> or <code>css</code>.
   * @return A {@link MediaType} or empty optional for unknown file extensions.
   */
Get a  MediaType for a file extension.
@param ext A file extension, like js or css.
@return A  MediaType or empty optional for unknown file extensions.
Get a MediaType for a file extension . @param ext A file extension like js or css . @return A MediaType or empty optional for unknown file extensions .
public static Optional<MediaType> byExtension(final String ext) {
    requireNonNull(ext, "An ext is required.");
    String key = "mime." + ext;
    if (types.hasPath(key)) {
      return Optional.of(MediaType.valueOf(types.getString("mime." + ext)));
    }
    return Optional.empty();
  }
public static Optional < MediaType > byExtension ( final String ext ) { requireNonNull ( ext , "An ext is required." ) ; String key = "mime." + ext ; if ( types . hasPath ( key ) ) { return Optional . of ( MediaType . valueOf ( types . getString ( "mime." + ext ) ) ) ; } return Optional . empty ( ) ; }
Get a {@link MediaType} for a file extension.
Get a { @link MediaType } for a file extension .