public class MimeTypesFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CUSTOM_MIMES_SYS_PROP
System property to set a path to an additional external custom mimetypes
XML file to be loaded.
|
| Constructor and Description |
|---|
MimeTypesFactory() |
| Modifier and Type | Method and Description |
|---|---|
static MimeTypes |
create()
Creates an empty instance; same as calling new MimeTypes().
|
static MimeTypes |
create(Document document)
Creates and returns a MimeTypes instance from the specified document.
|
static MimeTypes |
create(InputStream... inputStreams)
Creates and returns a MimeTypes instance from the specified input stream.
|
static MimeTypes |
create(InputStream stream) |
static MimeTypes |
create(String filePath)
Creates and returns a MimeTypes instance from the specified file path,
as interpreted by the class loader in getResource().
|
static MimeTypes |
create(String coreFilePath,
String extensionFilePath)
Creates and returns a MimeTypes instance.
|
static MimeTypes |
create(String coreFilePath,
String extensionFilePath,
ClassLoader classLoader)
Creates and returns a MimeTypes instance.
|
static MimeTypes |
create(URL... urls)
Creates and returns a MimeTypes instance from the resource
at the location specified by the URL.
|
static MimeTypes |
create(URL url) |
public static final String CUSTOM_MIMES_SYS_PROP
public static MimeTypes create()
public static MimeTypes create(Document document) throws MimeTypeException
MimeTypeException - if the type configuration is invalidpublic static MimeTypes create(InputStream... inputStreams) throws IOException, MimeTypeException
IOException - if the stream can not be readMimeTypeException - if the type configuration is invalidpublic static MimeTypes create(InputStream stream) throws IOException, MimeTypeException
IOExceptionMimeTypeExceptioncreate(InputStream...)public static MimeTypes create(URL... urls) throws IOException, MimeTypeException
IOException - if the URL can not be accessedMimeTypeException - if the type configuration is invalidpublic static MimeTypes create(URL url) throws IOException, MimeTypeException
IOExceptionMimeTypeExceptioncreate(URL...)public static MimeTypes create(String filePath) throws IOException, MimeTypeException
IOException - if the file can not be accessedMimeTypeException - if the type configuration is invalidpublic static MimeTypes create(String coreFilePath, String extensionFilePath) throws IOException, MimeTypeException
coreFilePath - The main MimeTypes file to loadextensionFilePath - The name of extension MimeType files to load afterwardsIOException - if the file can not be accessedMimeTypeException - if the type configuration is invalidpublic static MimeTypes create(String coreFilePath, String extensionFilePath, ClassLoader classLoader) throws IOException, MimeTypeException
CUSTOM_MIMES_SYS_PROP, if specified.coreFilePath - The main MimeTypes file to loadextensionFilePath - The name of extension MimeType files to load afterwardsIOException - if the file can not be accessedMimeTypeException - if the type configuration is invalidCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.