public abstract class FileFormatServiceRegistry<FF extends FileFormat,S> extends ServiceRegistry<FF,S>
ServiceRegistry
for FileFormat
related services.
This FileFormat-specific subclass offers some utility methods for matching
MIME types and file extensions to the file formats of registered services.logger, services
Modifier | Constructor and Description |
---|---|
protected |
FileFormatServiceRegistry(Class<S> serviceClass) |
Modifier and Type | Method and Description |
---|---|
Optional<FF> |
getFileFormatForFileName(String fileName)
Tries to match the extension of a file name against the list of registred
file formats.
|
Optional<FF> |
getFileFormatForMIMEType(String mimeType)
Tries to match a MIME type against the list of registered file formats.
|
public Optional<FF> getFileFormatForMIMEType(String mimeType)
mimeType
- A MIME type, e.g. "text/plain".FileFormat
, or Optional.empty()
if no
match was found.#getFileFormatForMIMEType(String, FileFormat)
public Optional<FF> getFileFormatForFileName(String fileName)
fileName
- A file name.FileFormat
, or Optional.empty()
if no
match was found.#getFileFormatForFileName(String, FileFormat)
Copyright © 2001-2016 Aduna. All Rights Reserved.