code: public static Optional<MediaType> byFile(final File file) {
      requireNonNull(file, "A file is required.");
      return byPath(file.getName());
    }
docs: Get a {@link MediaType} for a file.
  
  @param file A candidate file.
  @return A {@link MediaType} or {@link MediaType#octetstream} for unknown file extensions.