java.lang.Object
edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.contrib.methods.multipart.ContentType

public final class ContentType extends Object
This class provides mappings from file name extensions to content types.
Version:
$Revision: 480424 $ DISCLAIMER: HttpClient developers DO NOT actively support this component. The component is provided as a reference material, which may be inappropriate to be used without additional customization.
  • Field Details

    • MIME_TYPE_MAPPINGS

      public static final String[][] MIME_TYPE_MAPPINGS
      Mime Type mappings 'liberated' from Tomcat4.1.18/conf/web.xml
  • Method Details

    • get

      public static String get(String fileName)
      Get the content type based on the extension of the file name<br>
      Parameters:
      fileName - for which the content type is to be determined.
      Returns:
      the content type for the file or null if no mapping was possible.
    • get

      public static String get(File file)
      Get the content type based on the extension of the file name<br>
      Parameters:
      file - for which the content type is to be determined.
      Returns:
      the content type for the file or null if no mapping was possible.
      Throws:
      IOException - if the construction of the canonical path for the file fails.