|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrendsite.engine.node.Node
rendsite.engine.node.Node_File
public class Node_File
Crawler node for a File.
10NOV09 - EPG - First package release.
| Field Summary | |
|---|---|
Category |
category
Unlike type, category must not be inferred. |
boolean |
copyOnly
|
java.lang.String |
description
Information about the file. |
boolean |
excluded
|
boolean |
ignored
|
RenderingType |
renderingType
Rendering Type may be configured per file. |
java.lang.String |
type
Type may be configured per file, but if not present the renderer may decide a type based on other information. |
| Constructor Summary | |
|---|---|
Node_File(java.io.File sourceFile,
Node_Directory containingDir,
FileContext fcontext)
Create a node. |
|
Node_File(java.io.File sourceFile,
Node_Directory containingDir,
FileContext fcontext,
Node_File neighborOrigin)
Create a node. |
|
| Method Summary | |
|---|---|
void |
assertNeighbor(java.lang.String neighbor,
boolean isCataloged)
Assert that a neighbor exists. |
void |
copy()
Copy file from source to destination. |
void |
failWrite()
Not that the file write failed. |
Node_File |
getCatalogedFile()
Get the cataloged file. |
java.lang.String |
getFileExtension()
Get file extension. |
java.lang.String |
getName()
Get the rendered name. |
java.util.Collection<Node_File> |
getNeighbors()
Get all the neighbors. |
java.lang.String |
getURL(boolean encode)
Get the URL for this file. |
java.lang.String |
getURLRendering(boolean encode)
Get the rendering URL for this file. |
java.lang.String |
getURLtoRoot(boolean encode)
Get the URL to the root from directory which contains this file. |
boolean |
isNeighbor()
Is this is a neighbor file? If it is, the source doesn't actually exist. |
long |
lastModified()
Get the last modified date for the 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 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. |
void |
setRenderingType(RenderingType rType)
Set the rendering type. |
| Methods inherited from class rendsite.engine.node.Node |
|---|
getType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public boolean copyOnly
public boolean ignored
public boolean excluded
public java.lang.String description
public java.lang.String type
public RenderingType renderingType
public Category category
| Constructor Detail |
|---|
public Node_File(java.io.File sourceFile,
Node_Directory containingDir,
FileContext fcontext)
throws java.lang.Throwable
sourceFile - the source FS file.containingDir - the source Node Directory containing this file.fcontext - the file context.
java.lang.Throwable - mostly for bugs.
public Node_File(java.io.File sourceFile,
Node_Directory containingDir,
FileContext fcontext,
Node_File neighborOrigin)
throws java.lang.Throwable
sourceFile - the source FS file.containingDir - the source Node Directory containing this file.fcontext - the file context.neighborOrigin - set this to the file for which this is a neighbor.
java.lang.Throwable - mostly for bugs.| Method Detail |
|---|
public java.io.InputStream openForRead()
throws things.common.ThingsException
openForRead in interface FileInterfacethings.common.ThingsException
public java.io.OutputStream openForWrite()
throws things.common.ThingsException
openForWrite in interface FileInterfacethings.common.ThingsException
public void failWrite()
throws java.lang.Throwable
things.common.ThingsException - will only happen for bugs, which will be a panic.
java.lang.Throwable
public java.io.OutputStream openNeighborForWrite(java.lang.String neighbor,
boolean isCataloged)
throws things.common.ThingsException
openNeighborForWrite in interface FileInterfaceneighbor - the neighbor file name. This name must be unique for the neighborhood (containing directory) and can be used for other methods.isCataloged - will this file be cataloged?
things.common.ThingsException
public void assertNeighbor(java.lang.String neighbor,
boolean isCataloged)
throws things.common.ThingsException
neighbor - the neighbor file name. This name must be unique for the neighborhood (containing directory) and can be used for other methods.isCataloged - will this file be cataloged?
things.common.ThingsException
public void setCatalogNeighbor(java.lang.String neighbor)
throws things.common.ThingsException
setCatalogNeighbor in interface FileInterfaceneighbor - 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.
things.common.ThingsException - this will always happen if the neighbor has not been created through a openNeighborForWrite() call.
public long lastModified()
throws things.common.ThingsException
lastModified in interface FileInterfacethings.common.ThingsException
public long lastModifiedDestination()
throws things.common.ThingsException
lastModifiedDestination in interface FileInterfacethings.common.ThingsExceptionpublic java.util.Collection<Node_File> getNeighbors()
public java.lang.String getName()
getName in class Nodepublic java.lang.String getFileExtension()
public void setRenderingType(RenderingType rType)
rType - the rendering type. null is acceptable.public Node_File getCatalogedFile()
public boolean isNeighbor()
public java.lang.String getURL(boolean encode)
throws java.lang.Throwable
encode - encode the URL properly. Set to false for it to be display worthy.
java.lang.Throwable - if there is a problem forming the URL or a bug.public java.lang.String getURLRendering(boolean encode)
encode - encode the URL properly. Set to false for it to be display worthy.
public java.lang.String getURLtoRoot(boolean encode)
throws java.lang.Throwable
encode - encode the URL properly. Set to false for it to be display worthy.
java.lang.Throwable
public void copy()
throws things.common.ThingsException
java.lang.Throwable - if the file could not be copied.
things.common.ThingsException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||