org.exist.util
Class MimeTable

java.lang.Object
  extended byorg.exist.util.MimeTable

public class MimeTable
extends java.lang.Object

Global table of mime types. This singleton class maintains a list of mime types known to the system. It is used to look up the mime type for a specific file extension and to check if a file is an XML or binary resource. The mime type table is read from a file "mime-types.xml", which should reside in the directory identified in the exist home directory. If no such file is found, the class tries to load the default map from the org.exist.util package via the class loader.

Author:
wolf

Constructor Summary
MimeTable()
           
 
Method Summary
 MimeType getContentType(java.lang.String mimeType)
           
 MimeType getContentTypeFor(java.lang.String fileName)
           
 MimeType getContentTypeFor(XmldbURI fileName)
           
static MimeTable getInstance()
          Returns the singleton.
 java.lang.String getPreferredExtension(MimeType mimeType)
           
 java.lang.String getPreferredExtension(java.lang.String mimeType)
           
 java.lang.String getSrc()
          Inform from where a mime-table is loaded
 boolean isXMLContent(java.lang.String fileName)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeTable

public MimeTable()
Method Detail

getInstance

public static MimeTable getInstance()
Returns the singleton.


getSrc

public java.lang.String getSrc()
Inform from where a mime-table is loaded


getContentTypeFor

public MimeType getContentTypeFor(java.lang.String fileName)

getContentTypeFor

public MimeType getContentTypeFor(XmldbURI fileName)

getContentType

public MimeType getContentType(java.lang.String mimeType)

getPreferredExtension

public java.lang.String getPreferredExtension(java.lang.String mimeType)

getPreferredExtension

public java.lang.String getPreferredExtension(MimeType mimeType)

isXMLContent

public boolean isXMLContent(java.lang.String fileName)

main

public static void main(java.lang.String[] args)


Copyright (C) Wolfgang Meier. All rights reserved.