Top Description Methods
jakarta.activation.spi

public Interface MimeTypeRegistryProvider

Imports
jakarta.activation.MimeTypeRegistry, java.io.IOException, .InputStream, java.util.NoSuchElementException, .ServiceConfigurationError

This interface defines a factory for 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.

Method Summary

Modifier and TypeMethod and Description
public MimeTypeRegistry

Returns:

The instance of the MimeTypeRegistry, or null if none are found.
getByFileName
(String
The name of the file that stores MimeTypeEntries.
name
)

Retrieve an instance of the MimeTypeRegistry based on the name of the file where the MimeTypeEntries are stored.

public MimeTypeRegistry

Returns:

The instance of the MimeTypeRegistry, or null if none are found.
getByInputStream
(InputStream
InputStream for some resource that contains MimeTypeEntries.
inputStream
)

Retrieve an instance of the MimeTypeRegistry based on the InputStream that is used to read data from some named resource.

public MimeTypeRegistry

Returns:

In-memory implementation of the MimeTypeRegistry.
getInMemory
()

Retrieve an instance of the in-memory implementation of the MimeTypeRegistry.

Method Detail

getByFileNameback to summary
public MimeTypeRegistry getByFileName(String name) throws IOException

Retrieve an instance of the MimeTypeRegistry based on the name of the file where the MimeTypeEntries are stored.

Parameters
name:String

The name of the file that stores MimeTypeEntries.

Returns:MimeTypeRegistry

The instance of the MimeTypeRegistry, or null if none are found.

Exceptions
IOException:
If an instance of the MailcapRegistry class cannot be found or loaded.
getByInputStreamback to summary
public MimeTypeRegistry getByInputStream(InputStream inputStream) throws IOException

Retrieve an instance of the MimeTypeRegistry based on the InputStream that is used to read data from some named resource.

Parameters
inputStream:InputStream

InputStream for some resource that contains MimeTypeEntries.

Returns:MimeTypeRegistry

The instance of the MimeTypeRegistry, or null if none are found.

Exceptions
IOException:
If an instance of the MailcapRegistry class cannot be found or loaded.
getInMemoryback to summary
public MimeTypeRegistry getInMemory()

Retrieve an instance of the in-memory implementation of the MimeTypeRegistry. Jakarta Activation can throw NoSuchElementException or ServiceConfigurationError if no implementations were found.

Returns:MimeTypeRegistry

In-memory implementation of the MimeTypeRegistry.

Exceptions
NoSuchElementException:
If no implementations were found.
ServiceConfigurationError:
If no implementations were loaded.