-
public interface MimeTypeRegistryProvider
This interface defines a factory forMimeTypeRegistry
. 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 theMimeTypeRegistryProvider
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getByFileName
MimeTypeRegistry getByFileName(java.lang.String name) throws java.io.IOException
Retrieve an instance of the MimeTypeRegistry based on the name of the file where the MimeTypeEntries are stored.- Parameters:
name
- The name of the file that stores MimeTypeEntries.- Returns:
- The instance of the
MimeTypeRegistry
, or null if none are found. - Throws:
java.io.IOException
- If an instance of the MailcapRegistry class cannot be found or loaded.
-
getByInputStream
MimeTypeRegistry getByInputStream(java.io.InputStream inputStream) throws java.io.IOException
Retrieve an instance of the MimeTypeRegistry based on the InputStream that is used to read data from some named resource.- Parameters:
inputStream
- InputStream for some resource that contains MimeTypeEntries.- Returns:
- The instance of the
MimeTypeRegistry
, or null if none are found. - Throws:
java.io.IOException
- If an instance of the MailcapRegistry class cannot be found or loaded.
-
getInMemory
MimeTypeRegistry getInMemory()
Retrieve an instance of the in-memory implementation of the MimeTypeRegistry. Jakarta Activation can throwNoSuchElementException
orServiceConfigurationError
if no implementations were found.- Returns:
- In-memory implementation of the MimeTypeRegistry.
- Throws:
java.util.NoSuchElementException
- If no implementations were found.java.util.ServiceConfigurationError
- If no implementations were loaded.
-
-