Package kilim.http

Class MimeTypes

java.lang.Object
kilim.http.MimeTypes

public class MimeTypes extends Object
mime types to simplify building http servers. this class is for convenience and doesn't attempt to be canonical
  • Field Details

  • Constructor Details

    • MimeTypes

      public MimeTypes()
  • Method Details

    • mimeType

      public static String mimeType(File file)
      get the mime type of a file based on it's filename extension
      Parameters:
      file - a file
      Returns:
      the mime type, or text/plain if not found
    • mimeType

      public static String mimeType(String name)
      get the mime type of a filename based on it's extension
      Parameters:
      name - the name of a file
      Returns:
      the mime type, or text/plain if not found
    • cloneMap

      public static HashMap<String,String> cloneMap()