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 |
---|---|
FF |
getFileFormatForFileName(String fileName)
Tries to match the extension of a file name against the list of registred
file formats.
|
FF |
getFileFormatForFileName(String fileName,
FF fallback)
Tries to match the extension of a file name against the list of registred
file formats.
|
FF |
getFileFormatForMIMEType(String mimeType)
Tries to match a MIME type against the list of registered file formats.
|
FF |
getFileFormatForMIMEType(String mimeType,
FF fallback)
Tries to match a MIME type against the list of registred file formats.
|
public FF getFileFormatForMIMEType(String mimeType)
mimeType
- A MIME type, e.g. "text/plain".FileFormat
, or null if no match
was found.getFileFormatForMIMEType(String, FileFormat)
public FF getFileFormatForMIMEType(String mimeType, FF fallback)
FileFormat.matchMIMEType(String, Iterable, FileFormat)
with the
specified MIME type, the keys
of this registry and the
fallback format as parameters.mimeType
- A MIME type, e.g. "text/plain".fallback
- The format that will be returned if no match was found.FileFormat
, or fallback if no
match was found.public FF getFileFormatForFileName(String fileName)
fileName
- A file name.FileFormat
, or null if no match
was found.getFileFormatForFileName(String, FileFormat)
public FF getFileFormatForFileName(String fileName, FF fallback)
FileFormat.matchFileName(String, Iterable, FileFormat)
with the
specified MIME type, the keys
of this registry and the
fallback format as parameters.fileName
- A file name.fallback
- The format that will be returned if no match was found.FileFormat
, or fallback if no
match was found.Copyright © 2001-2016 Aduna. All Rights Reserved.