Package ch.grengine.source
Class DefaultFileSource
java.lang.Object
ch.grengine.source.BaseSource
ch.grengine.source.DefaultFileSource
- All Implemented Interfaces:
FileSource,Source
File-based script source, default implementation of the
FileSource interface.
The source ID is "ScriptFile_<canonical-or-absolute-file-path>".
- Since:
- 1.0
- Author:
- Alain Stalder, Made in Switzerland.
-
Field Summary
Fields inherited from class ch.grengine.source.BaseSource
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFile()gets the canonical file of this source, with fallback to the absolute file.longalways returns 0.Methods inherited from class ch.grengine.source.BaseSource
equals, getId, hashCode, toString
-
Constructor Details
-
DefaultFileSource
constructor from script file.The file is always converted to the canonical file, with fallback to the absolute file.
The ID is the canonical file path, with fallback to the absolute file path.
- Parameters:
file- script file- Throws:
NullPointerException- if file is null- Since:
- 1.0
-
-
Method Details
-
getLastModified
public long getLastModified()Description copied from class:BaseSourcealways returns 0.- Specified by:
getLastModifiedin interfaceSource- Overrides:
getLastModifiedin classBaseSource- Returns:
- always 0
-
getFile
Description copied from interface:FileSourcegets the canonical file of this source, with fallback to the absolute file.Hence
fileSource.getFile().isAbsolute()always returns true.- Specified by:
getFilein interfaceFileSource- Returns:
- canonical file of this source
-