public class TemporalFileDocument extends Object implements TemporalDocument
TemporalDocument
implementation backed by a File
whose
contents are used for the document text.Constructor and Description |
---|
TemporalFileDocument(File file)
Constructs a
TemporalDocument using the contents of the provided
file, using the lastModified time as its
creation time. |
TemporalFileDocument(File file,
long timeStamp)
Constructs a
TemporalDocument using the contents of the provided
file, which was created at the specified time. |
TemporalFileDocument(String fileName)
Constructs a
TemporalDocument using the contents of the provided
file, using the lastModified time as its
creation time. |
TemporalFileDocument(String fileName,
long timeStamp)
Constructs a
TemporalDocument using the contents of the provided
file, which was created at the specified time. |
Modifier and Type | Method and Description |
---|---|
BufferedReader |
reader()
Returns the
BufferedReader for this document's text |
long |
timeStamp()
Returns the time at which this document was created.
|
public TemporalFileDocument(String fileName) throws IOException
TemporalDocument
using the contents of the provided
file, using the lastModified
time as its
creation time.fileName
- the name of a file whose contents will be used as a
documentIOException
- if any error occurred while reading fileName
.public TemporalFileDocument(File file) throws IOException
TemporalDocument
using the contents of the provided
file, using the lastModified
time as its
creation time.file
- a file whose contents will be used as a documentIOException
- if any error occurred while reading fileName
.public TemporalFileDocument(String fileName, long timeStamp) throws IOException
TemporalDocument
using the contents of the provided
file, which was created at the specified time.fileName
- the name of a file whose contents will be used as a
documenttimeStamp
- the time at which this file was createdIOException
- if any error occurred while reading fileName
.public TemporalFileDocument(File file, long timeStamp) throws IOException
TemporalDocument
using the contents of the provided
file, which was created at the specified time.file
- a file whose contents will be used as a documenttimeStamp
- the time at which this file was createdIOException
- if any error occurred while reading fileName
.public BufferedReader reader()
BufferedReader
for this document's textpublic long timeStamp()
timeStamp
in interface TemporalDocument
Copyright © 2012. All Rights Reserved.