Interface MailcapRegistryProvider

All Known Implementing Classes:
MailcapRegistryProviderImpl

public interface MailcapRegistryProvider
This interface defines a factory for MailcapRegistry. An implementation of this interface should provide instances of the MailcapRegistry based on the way how to access the storage for MailcapEntries.

Jakarta Activation uses Service Provider Interface and ServiceLoader to obtain an instance of the implementation of the MailcapRegistryProvider.

  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieve an instance of the MailcapRegistry based on the name of the file where the MailcapEntries are stored.
    Retrieve an instance of the MailcapRegistry based on the InputStream that is used to read data from some named resource.
    Retrieve an instance of the in-memory implementation of the MailcapRegistry.
  • Method Details

    • getByFileName

      MailcapRegistry getByFileName(String name) throws IOException
      Retrieve an instance of the MailcapRegistry based on the name of the file where the MailcapEntries are stored.
      Parameters:
      name - The name of the file that stores MailcapEntries.
      Returns:
      The instance of the MailcapRegistry, or null if none are found.
      Throws:
      IOException - If an instance of the MailcapRegistry class cannot be found or loaded.
    • getByInputStream

      MailcapRegistry getByInputStream(InputStream inputStream) throws IOException
      Retrieve an instance of the MailcapRegistry based on the InputStream that is used to read data from some named resource.
      Parameters:
      inputStream - InputStream for some resource that contains MailcapEntries.
      Returns:
      The instance of the MailcapRegistry, or null if none are found.
      Throws:
      IOException - If an instance of the MailcapRegistry class cannot be found or loaded.
    • getInMemory

      MailcapRegistry getInMemory()
      Retrieve an instance of the in-memory implementation of the MailcapRegistry.
      Returns:
      In-memory implementation of the MailcapRegistry.
      Throws:
      NoSuchElementException - If no implementations were found.
      ServiceConfigurationError - If no implementations were loaded.