public interface MimeTypeRegistryProvider
MimeTypeRegistry
. An
implementation of this interface should provide instances of the MimeTypeRegistry
based on the way how to access the storage for MimeTypeEntries.
Jakarta Activation uses Service Provider Interface and ServiceLoader
to obtain an instance of the implementation of the MimeTypeRegistryProvider
.
Modifier and Type | Method and Description |
---|---|
MimeTypeRegistry |
getByFileName(java.lang.String name)
Retrieve an instance of the MimeTypeRegistry based on the name of the file where the MimeTypeEntries are stored.
|
MimeTypeRegistry |
getByInputStream(java.io.InputStream inputStream)
Retrieve an instance of the MimeTypeRegistry based on the InputStream
that is used to read data from some named resource.
|
MimeTypeRegistry |
getInMemory()
Retrieve an instance of the in-memory implementation of the MimeTypeRegistry.
|
MimeTypeRegistry getByFileName(java.lang.String name) throws java.io.IOException
name
- The name of the file that stores MimeTypeEntries.MimeTypeRegistry
, or null if none are found.java.io.IOException
- If an instance of the MailcapRegistry class cannot be found or loaded.MimeTypeRegistry getByInputStream(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- InputStream for some resource that contains MimeTypeEntries.MimeTypeRegistry
, or null if none are found.java.io.IOException
- If an instance of the MailcapRegistry class cannot be found or loaded.MimeTypeRegistry getInMemory()
NoSuchElementException
or ServiceConfigurationError
if no implementations were found.java.util.NoSuchElementException
- If no implementations were found.java.util.ServiceConfigurationError
- If no implementations were loaded.