jooby/src/main/java/org/jooby/MediaType.java
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.

@param ext A file extension, like <code>js</code> or <code>css</code>.
@return A {@link MediaType} or empty optional for unknown file extensions.