|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.util.MimeTable
public class MimeTable
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.
Constructor Summary | |
---|---|
MimeTable()
|
|
MimeTable(File f)
|
|
MimeTable(InputStream stream,
String src)
|
Method Summary | |
---|---|
Vector |
getAllExtensions(MimeType mimeType)
|
Vector |
getAllExtensions(String mimeType)
|
MimeType |
getContentType(String mimeType)
|
MimeType |
getContentTypeFor(String fileName)
|
MimeType |
getContentTypeFor(XmldbURI fileName)
|
static MimeTable |
getInstance()
Returns the singleton. |
static MimeTable |
getInstance(File f)
Returns the singleton, using a custom mime-types.xml file |
static MimeTable |
getInstance(InputStream stream,
String src)
Returns the singleton, using a custom mime-types.xml stream, like for instance an internal database resource. |
String |
getPreferredExtension(MimeType mimeType)
|
String |
getPreferredExtension(String mimeType)
|
String |
getSrc()
Inform from where a mime-table is loaded |
boolean |
isXMLContent(String fileName)
|
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MimeTable()
public MimeTable(File f)
public MimeTable(InputStream stream, String src)
Method Detail |
---|
public static MimeTable getInstance()
public static MimeTable getInstance(File f)
public static MimeTable getInstance(InputStream stream, String src)
public String getSrc()
public MimeType getContentTypeFor(String fileName)
public MimeType getContentTypeFor(XmldbURI fileName)
public MimeType getContentType(String mimeType)
public Vector getAllExtensions(MimeType mimeType)
public Vector getAllExtensions(String mimeType)
public String getPreferredExtension(MimeType mimeType)
public String getPreferredExtension(String mimeType)
public boolean isXMLContent(String fileName)
public static void main(String[] args)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |