Package org.anchoranalysis.core.format
Interface FileFormat
- All Known Implementing Classes:
ImageFileFormat
,NonImageFileFormat
public interface FileFormat
A file-format that is read or written to the filesystem.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Builds a path which has an existing path but missing an extension.default String
Builds a path with a directory and filename component.default Path
Builds a path which has an existing path but missing an extension.default Path
Builds a path with a directory and filename component.An identifier that describes the format, that is meaningful to the end-user.The default extension to write associated with a particular format.boolean
Does a file-path (or file-name) end with an extension expected by this format?default boolean
Does a filePath (or fileName) have an extension expected by this format?boolean
matchesIdentifier
(String identifier) Does an identifier equal the extension expected by this format?
-
Method Details
-
matches
Does a filePath (or fileName) have an extension expected by this format?The case of the extension is irrelevant i.e. a case insensitive match occurs.
- Parameters:
filePath
- the path- Returns:
- true if the path ends with any of the expected extensions for this format.
-
matches
Does a file-path (or file-name) end with an extension expected by this format?The case of the extension is irrelevant i.e. a case insensitive match occurs.
A leading period is also expected before the extension.
- Parameters:
filePath
- the path- Returns:
- true if the path ends with any of the expected extensions for this format.
-
matchesIdentifier
Does an identifier equal the extension expected by this format?- Parameters:
identifier
- an identifier that should be equal (ignoring case, and with or without a leading period) to any extension associated with the format- Returns:
- true if
identifier
is equal to an extension associated with this format
-
descriptiveIdentifier
String descriptiveIdentifier()An identifier that describes the format, that is meaningful to the end-user.- Returns:
- a short string that identifies the format (usually the default extension without any leading period).
-
getDefaultExtension
String getDefaultExtension()The default extension to write associated with a particular format.- Returns:
- the extension
-
buildPath
Builds a path which has an existing path but missing an extension.- Parameters:
path
- the path- Returns:
- the path with an extension appended.
-
buildPath
Builds a path which has an existing path but missing an extension.- Parameters:
path
- the path- Returns:
- the path with an extension appended.
-
buildPath
Builds a path with a directory and filename component.- Parameters:
directory
- the directoryfilenameWithoutExtension
- a filename that resides in the directory (without any extension or the period preceding an extension)- Returns:
- a path that combines the
directory
andfilenameWithoutExtension
and the extension.
-
buildPath
Builds a path with a directory and filename component.- Parameters:
directory
- the directoryfilenameWithoutExtension
- a filename that resides in the directory (without any extension or the period preceding an extension)- Returns:
- a string representing a path that combines the
directory
andfilenameWithoutExtension
and the extension.
-