rendsite.engine
Interface FileInterface

All Known Implementing Classes:
Node_File

public interface FileInterface

Public interface to interacting with a file from the engine.

Author:
erich Version History
 10NOV09 - EPG - First package release.
 

Method Summary
 long lastModified()
          Get the last modified date for the source file.
 long lastModifiedDestination()
          Get the last modified date for the destination file.
 java.io.InputStream openForRead()
          Open for the file for reading.
 java.io.OutputStream openForWrite()
          Open for the file in the destination for writing.
 java.io.OutputStream openNeighborForWrite(java.lang.String neighbor, boolean isCataloged)
          Open a neighbor file in the destination for writing.
 void setCatalogNeighbor(java.lang.String neighbor)
          Set a neighbor as the catalog file instead of this.
 

Method Detail

openForRead

java.io.InputStream openForRead()
                                throws things.common.ThingsException
Open for the file for reading. The stream will not be buffered. You should close it when you are done.

Returns:
an input stream for reading.
Throws:
things.common.ThingsException

openForWrite

java.io.OutputStream openForWrite()
                                  throws things.common.ThingsException
Open for the file in the destination for writing. The stream will not be buffered. You should close it when you are done. It will mark the file as having been updated for other processing.

Returns:
an output stream for writing.
Throws:
things.common.ThingsException

openNeighborForWrite

java.io.OutputStream openNeighborForWrite(java.lang.String neighbor,
                                          boolean isCataloged)
                                          throws things.common.ThingsException
Open a neighbor file in the destination for writing. The stream will not be buffered. You should close it when you are done. It will mark the file as having been updated for other processing.

Parameters:
neighbor - the neighbor file name
isCataloged - will this file be cataloged?
Returns:
an output stream for writing.
Throws:
things.common.ThingsException

setCatalogNeighbor

void setCatalogNeighbor(java.lang.String neighbor)
                        throws things.common.ThingsException
Set a neighbor as the catalog file instead of this.

Parameters:
neighbor - the neighbor file name. This name must be unique for the neighborhood (containing directory) and can be used for other methods. It is case sensitive.
Throws:
things.common.ThingsException - this will always happen if the neighbor has not been created through a openNeighborForWrite() call.

lastModified

long lastModified()
                  throws things.common.ThingsException
Get the last modified date for the source file. If it is a neighbor, it'll get it for its origin.

Returns:
the last modified date as milliseconds from epoch.
Throws:
things.common.ThingsException

lastModifiedDestination

long lastModifiedDestination()
                             throws things.common.ThingsException
Get the last modified date for the destination file. If it is a neighbor, it'll get it for its origin.

Returns:
the last modified date as milliseconds from epoch.
Throws:
things.common.ThingsException


rendsite.