Klasse FileSource
java.lang.Object
org.apache.torque.generator.source.SourceImpl
org.apache.torque.generator.source.stream.FileSource
- Alle implementierten Schnittstellen:
Source
A Source which uses a file as input.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungFileSource
(StreamSourceFormat format, File path, ControllerState controllerState) Constructor. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungReads and parses the input file and creates the element tree from it.byte[]
Returns the checksum of the content.Returns the path of the file as a description.Returns the date when the source was last modified.getPath()
Returns the path to the source file.Returns the source file, if it exists.Returns the format of the source.toString()
Von Klasse geerbte Methoden org.apache.torque.generator.source.SourceImpl
getRootElement
-
Konstruktordetails
-
FileSource
Constructor.- Parameter:
format
- the source format, not null.path
- the path to the file to read, not null.controllerState
- the controller state, not null.- Löst aus:
NullPointerException
- if path or format is null.
-
-
Methodendetails
-
getSourceFormat
Returns the format of the source.- Gibt zurück:
- the source format, not null.
-
getPath
Returns the path to the source file.- Gibt zurück:
- the path to the source file, not null.
-
createRootElement
Reads and parses the input file and creates the element tree from it.- Angegeben von:
createRootElement
in KlasseSourceImpl
- Gibt zurück:
- the root element of the element tree.
- Löst aus:
SourceException
- if the input file cannot be read or parsed.
-
getDescription
Returns the path of the file as a description.- Gibt zurück:
- path of the file, not null.
- Siehe auch:
-
getSourceFile
Returns the source file, if it exists.- Gibt zurück:
- the source file, or null if the source is not read from a file.
-
getLastModified
Returns the date when the source was last modified.- Gibt zurück:
- the last modification date, or null when unknown.
-
getContentChecksum
public byte[] getContentChecksum()Returns the checksum of the content.- Gibt zurück:
- the md5 sum of the content, or null if the implementation does not support creating the checksum, or if the source is unread and reading the source fails.
-
toString
-