org.exist.util
Class MimeTable
java.lang.Object
org.exist.util.MimeTable
public class MimeTable
- extends 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
MimeTable
public MimeTable()
getInstance
public static MimeTable getInstance()
- Returns the singleton.
getSrc
public String getSrc()
- Inform from where a mime-table is loaded
getContentTypeFor
public MimeType getContentTypeFor(String fileName)
getContentTypeFor
public MimeType getContentTypeFor(XmldbURI fileName)
getContentType
public MimeType getContentType(String mimeType)
getAllExtensions
public Vector getAllExtensions(MimeType mimeType)
getAllExtensions
public Vector getAllExtensions(String mimeType)
getPreferredExtension
public String getPreferredExtension(MimeType mimeType)
getPreferredExtension
public String getPreferredExtension(String mimeType)
isXMLContent
public boolean isXMLContent(String fileName)
main
public static void main(String[] args)
Copyright (C) Wolfgang Meier. All rights reserved.