|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrendsite.engine.Context
rendsite.engine.FileContext
public class FileContext
Context for files in a run. It keeps track of file changes.
10NOV09 - EPG - First package release.
| Field Summary |
|---|
| Fields inherited from class rendsite.engine.Context |
|---|
configuration, logger, si |
| Constructor Summary | |
|---|---|
FileContext(RendsiteConfiguration configuration,
java.io.File sourceDirectory,
java.io.File outputDirectory)
Create a context. |
|
| Method Summary | |
|---|---|
java.io.File |
getOutputDirectory(java.lang.String source)
Get the output file for the given directory node. |
java.io.File |
getOutputFile(java.lang.String sourcePath)
Get the output file for the given node. |
Node_Directory |
getRoot()
Get the root directory. |
java.io.File |
getSourceFile(java.lang.String pathOffset)
Get a source file. |
java.lang.String |
getURL(Node_Directory source,
Node_Directory target,
boolean encode)
Get the URL for this directory based on the path which will be pointed at by the source directory. |
java.lang.String |
getURL(Node_Directory source,
Node_Directory target,
java.lang.String fileName,
boolean encode)
Get a URL for this file in the target directory which will be pointed at by the source directory. |
java.lang.String |
getUrl(java.lang.String base,
java.lang.String target,
boolean encode)
Get a url from a path within the root. |
java.lang.String |
getURLAbsolute(Node_Directory target,
boolean encode)
Get absolute URL for the directory. |
java.lang.String |
getURLAbsolute(Node_Directory target,
java.lang.String fileName,
boolean encode)
Get absolute URL for the file. |
java.lang.String |
getURLFromRoot(Node_Directory source,
java.lang.String url,
boolean encode)
Get related URL for the directory from the root. |
java.lang.String |
getURLToRoot(Node_Directory source,
boolean encode)
Get related URL to the root from the directory. |
boolean |
isExempt(java.io.File theFile)
If the file is exempt, return true. |
void |
notifyChange(java.lang.String path,
Node_File theFile)
Notify the context that the file changed. |
void |
notifyChangeDelete(java.lang.String path,
Node_File theFile)
Notify the context that the file changed because it was deleted. |
void |
notifyChangeFailed(java.lang.String path,
Node_File theFile)
Notify the context that the file changed failed. |
void |
register(FileNotice_Notifier fileNotifier)
Register notifier. |
void |
registerExemptFile(java.io.File theFile)
The file will be exempt from certain system functions, such as cleaning. |
void |
reset()
Reset the context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileContext(RendsiteConfiguration configuration,
java.io.File sourceDirectory,
java.io.File outputDirectory)
throws java.lang.Throwable
configuration - the configuration for the system.sourceDirectory - path to the source directory.outputDirectory - path to the output directory.
java.lang.Throwable - normally this will only happen if you pass a null or bad SystemInterface.| Method Detail |
|---|
public void reset()
throws java.lang.Throwable
reset in interface Resetablereset in class Contextjava.lang.Throwable - if it could not completely reset state.public void register(FileNotice_Notifier fileNotifier)
fileNotifier - the notifier. If null, it'll not notify anyone. You can turn off a previously registered notifier by calling with a null.
public void notifyChange(java.lang.String path,
Node_File theFile)
throws java.lang.Throwable
path - absolute source path. (Destination is ok too, but it best to be consistent).theFile - the file that changed.
java.lang.Throwable
public void notifyChangeFailed(java.lang.String path,
Node_File theFile)
throws java.lang.Throwable
path - absolute source path. (Destination is ok too, but it best to be consistent).theFile - the file where the change failed.
java.lang.Throwable
public void notifyChangeDelete(java.lang.String path,
Node_File theFile)
throws java.lang.Throwable
path - absolute source path. (Destination is ok too, but it best to be consistent).theFile - the file where it was deleted.
java.lang.Throwable
public void registerExemptFile(java.io.File theFile)
throws java.lang.Throwable
theFile -
java.lang.Throwable
public boolean isExempt(java.io.File theFile)
throws java.lang.Throwable
theFile - the file to check for exemption.
java.lang.Throwablepublic Node_Directory getRoot()
public java.io.File getSourceFile(java.lang.String pathOffset)
throws java.lang.Throwable
pathOffset - path from the source root to the file.
java.lang.Throwable - if the pathOffset is null or empty.
public java.io.File getOutputFile(java.lang.String sourcePath)
throws java.lang.Throwable
sourcePath - absolute path to source file.
java.lang.Throwable
public java.io.File getOutputDirectory(java.lang.String source)
throws java.lang.Throwable
source -
java.lang.Throwable
public java.lang.String getURLFromRoot(Node_Directory source,
java.lang.String url,
boolean encode)
throws java.lang.Throwable
source - where we are starting from.url - the url. Do not start with a 'slash' (will cause an exception).encode - encode the URL properly. Set to false for it to be display worthy.
java.lang.Throwable
public java.lang.String getURLToRoot(Node_Directory source,
boolean encode)
throws java.lang.Throwable
source - where we are starting from.encode - encode the URL properly. Set to false for it to be display worthy.
java.lang.Throwable
public java.lang.String getURL(Node_Directory source,
Node_Directory target,
boolean encode)
throws java.lang.Throwable
source - from where this will be pointed at. It is useful for relative paths (if needed). If set to null, it will always be treated as the same directory.target - the target from which to get the URL.encode - encode the URL properly. Set to false for it to be display worthy.
java.lang.Throwable
public java.lang.String getURL(Node_Directory source,
Node_Directory target,
java.lang.String fileName,
boolean encode)
throws java.lang.Throwable
source - from where this will be pointed at. It is useful for relative paths (if needed). If set to null, it will always be treated as the same directory.target - the target from which to get the URL.fileName - the filename for the file.encode - encode the URL properly. Set to false for it to be display worthy.
java.lang.Throwable
public java.lang.String getUrl(java.lang.String base,
java.lang.String target,
boolean encode)
throws java.lang.Throwable
base - from where this will be pointed (useful if the context needs to make relative paths).encode - encode the URL properly.
java.lang.Throwable
public java.lang.String getURLAbsolute(Node_Directory target,
boolean encode)
throws java.lang.Throwable
target - the target from which to get the URL.encode - encode the URL properly. Set to false for it to be display worthy.
java.lang.Throwable
public java.lang.String getURLAbsolute(Node_Directory target,
java.lang.String fileName,
boolean encode)
throws java.lang.Throwable
target - the directory containing the file.fileName - the filename for the file.encode - encode the URL properly. Set to false for it to be display worthy.
java.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||