Class ExtensionBasedFileFormat
java.lang.Object
de.iip_ecosphere.platform.support.FileFormat
de.iip_ecosphere.platform.support.ExtensionBasedFileFormat
A file format just based on extensions. Although not nice, still many file formats are just identified by
extensions, also as this rather easy to check.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExtensionBasedFileFormat(String extension, String name, String description) Creates an instance. -
Method Summary
Methods inherited from class de.iip_ecosphere.platform.support.FileFormat
getDescription, getName
-
Field Details
-
extension
-
-
Constructor Details
-
ExtensionBasedFileFormat
Creates an instance.- Parameters:
extension- the file name extension to check for, without the "." (normalized out)name- the name of the file formatdescription- a free-text description of the file format
-
-
Method Details
-
getExtension
Returns the extension.- Returns:
- the extension (without leading ".")
-
matches
Description copied from class:FileFormatReturns whether the given file matches the file format. This may be based on an anlysis of magic numbers, the file extension, etc.- Specified by:
matchesin classFileFormat- Parameters:
file- the file to check- Returns:
trueif the givenfilematches this file format,falseelse
-
toString
- Overrides:
toStringin classFileFormat
-