Class FileFormatServiceRegistry<FF extends FileFormat,​S>

    • Constructor Detail

      • FileFormatServiceRegistry

        protected FileFormatServiceRegistry​(java.lang.Class<S> serviceClass)
    • Method Detail

      • getFileFormatForMIMEType

        public java.util.Optional<FF> getFileFormatForMIMEType​(java.lang.String mimeType)
        Tries to match a MIME type against the list of registered file formats.
        Parameters:
        mimeType - A MIME type, e.g. "text/plain".
        Returns:
        The matching FileFormat, or Optional.empty() if no match was found.
      • getFileFormatForFileName

        public java.util.Optional<FF> getFileFormatForFileName​(java.lang.String fileName)
        Tries to match the extension of a file name against the list of registred file formats.
        Parameters:
        fileName - A file name.
        Returns:
        The matching FileFormat, or Optional.empty() if no match was found.