public interface FileFormat
Modifier and Type | Method and Description |
---|---|
default Path |
buildPath(Path path)
Builds a path which has an existing path but missing an extension.
|
default Path |
buildPath(Path directory,
String filenameWithoutExtension)
Builds a path with a directory and filename component.
|
default String |
buildPath(String path)
Builds a path which has an existing path but missing an extension.
|
default String |
buildPath(String directory,
String filenameWithoutExtension)
Builds a path with a directory and filename component.
|
default String |
buildPath(String directory,
String subdirectory,
String filenameWithoutExtension)
Builds a path with a directory, subdirectory, and filename component.
|
String |
descriptiveIdentifier()
An identifier that describes the format, that is meaningful to the end-user.
|
String |
getDefaultExtension()
The default extension to write associated with a particular format.
|
default boolean |
matches(Path filePath)
Does a filePath (or fileName) have an extension expected by this format?
|
boolean |
matches(String filePath)
Does a file-path (or file-name) end with an extension expected by this format?
|
boolean |
matchesIdentifier(String identifier)
Does an identifier equal the extension expected by this format?
|
default boolean matches(Path filePath)
The case of the extension is irrelevant i.e. a case insensitive match occurs.
filePath
- the pathboolean matches(String filePath)
The case of the extension is irrelevant i.e. a case insensitive match occurs.
A leading period is also expected before the extension.
filePath
- the pathboolean matchesIdentifier(String identifier)
identifier
- an identifier that should be equal (ignoring case, and with or without a
leading period) to any extension associated with the formatidentifier
is equal to an extension associated with this formatString descriptiveIdentifier()
String getDefaultExtension()
default String buildPath(String path)
path
- the pathdefault Path buildPath(Path path)
path
- the pathdefault Path buildPath(Path directory, String filenameWithoutExtension)
directory
- the directoryfilenameWithoutExtension
- a filename that resides in the directory (without any
extension or the period preceding an extension)directory
and filenameWithoutExtension
and
the extension.default String buildPath(String directory, String filenameWithoutExtension)
directory
- the directoryfilenameWithoutExtension
- a filename that resides in the directory (without any
extension or the period preceding an extension)directory
and filenameWithoutExtension
and the extension.default String buildPath(String directory, String subdirectory, String filenameWithoutExtension)
directory
- the directorysubdirectory
- the name of a directory that should reside in directory
filenameWithoutExtension
- a filename that resides in the subdirectory
(without
any extension or the period preceding an extension)directory
and subdirectory
and filenameWithoutExtension
and the extension.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.