|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnu.staldal.lagoon.core.LagoonProcessor
public class LagoonProcessor
The main worker class of the Lagoon core. Initialized with the sitemap, a source dir and a target storage URL. Then building the website may be done several times, until destroy() is invoked. This class is not thread-safe. The methods must not be invoked concurrently from different threads.
| Constructor Summary | |
|---|---|
LagoonProcessor(java.lang.String targetURL,
Element sitemapTree,
java.io.File sourceDir,
java.lang.String password,
java.io.PrintWriter log,
java.io.PrintWriter err)
Constructs and initializes a LagoonProcessor. |
|
| Method Summary | |
|---|---|
boolean |
build(boolean force)
Perform the building of the website. |
boolean |
canCheckFileHasBeenUpdated(java.lang.String url)
Tell whether the given source can be checked for dependency. |
void |
deleteClassInRepository(java.lang.String className)
Delete a Java class file from the repository. |
void |
destroy()
Dispose this object and release any resources it holds. |
java.lang.String |
getFileURLRelativeTo(java.lang.String url,
java.lang.String base)
Get an URL representing the given file or directory. |
java.lang.Object |
getObjectFromRepository(java.lang.String key)
Get an object from the repository. |
java.lang.String |
getProperty(java.lang.String key)
Return the value of a project property. |
java.io.File |
getSourceRootDir()
Get an absolute File object representing the source root directory. |
java.io.File |
getTempDir()
Get the temp directory. |
java.lang.Class |
loadClassFromRepository(java.lang.String className)
Load a Java class file from the repository. |
boolean |
putObjectIntoRepository(java.lang.String key,
java.lang.Object obj)
Store an object into the repository. |
java.io.InputStream |
readFileFromRepository(java.lang.String key)
Read from a file in the repository. |
void |
reloadClasses()
Reload classes. |
java.io.OutputStream |
storeClassInRepository(java.lang.String className)
Store a Java class file in the repository. |
java.io.OutputStream |
storeFileInRepository(java.lang.String key)
Store a file in the repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LagoonProcessor(java.lang.String targetURL,
Element sitemapTree,
java.io.File sourceDir,
java.lang.String password,
java.io.PrintWriter log,
java.io.PrintWriter err)
throws java.io.IOException,
LagoonException,
AuthenticationException,
AuthenticationMissingException
targetURL - where to put the generated files,
must be an absolute URL or a local file pathsitemapTree - the Sitemap as an XTreesourceDir - where the source files arepassword - password to access the target storage, or
null if not nessesary.log - where to write progress messages.err - where to write error messages.
java.io.IOException
LagoonException
AuthenticationException
AuthenticationMissingException| Method Detail |
|---|
public boolean build(boolean force)
throws java.io.IOException
force - force a rebuild of all files, otherwise dependency
checking is used to check which files that needs rebuilding.
java.io.IOException - if any fatal error occur
public void destroy()
throws java.io.IOException
java.io.IOExceptionpublic java.io.File getTempDir()
LagoonContext
getTempDir in interface LagoonContextpublic java.io.InputStream readFileFromRepository(java.lang.String key)
LagoonContext
readFileFromRepository in interface LagoonContextkey - the key to locate the file
null
if the file wasn't found.
public java.io.OutputStream storeFileInRepository(java.lang.String key)
throws java.io.IOException
LagoonContext
storeFileInRepository in interface LagoonContextkey - the key to locate the file
null
if the repository is unavailable.
java.io.IOException
public java.lang.Class loadClassFromRepository(java.lang.String className)
throws java.lang.ClassNotFoundException
LagoonContext
loadClassFromRepository in interface LagoonContextclassName - the class name, no package
null
java.lang.ClassNotFoundException - if the class cannot be loaded
public java.io.OutputStream storeClassInRepository(java.lang.String className)
throws java.io.IOException
LagoonContext
storeClassInRepository in interface LagoonContextclassName - the class name, no package
null
if the repository is unavailable.
java.io.IOException
public void deleteClassInRepository(java.lang.String className)
throws java.io.IOException
LagoonContext
deleteClassInRepository in interface LagoonContextclassName - the class name, no package
java.io.IOExceptionpublic void reloadClasses()
LagoonContext
reloadClasses in interface LagoonContext
public java.lang.Object getObjectFromRepository(java.lang.String key)
throws java.io.IOException
LagoonContext
getObjectFromRepository in interface LagoonContextkey - the key to locate the object
null if not found
java.io.IOException
public boolean putObjectIntoRepository(java.lang.String key,
java.lang.Object obj)
throws java.io.IOException
LagoonContext
putObjectIntoRepository in interface LagoonContextkey - the key to locate the objectobj - the object to store, must be Serializable
true if successful,
false if the repository is unavailable.
java.io.IOExceptionpublic boolean canCheckFileHasBeenUpdated(java.lang.String url)
LagoonContext
canCheckFileHasBeenUpdated in interface LagoonContexturl - URL to the filepublic java.io.File getSourceRootDir()
LagoonContext
getSourceRootDir in interface LagoonContext
public java.lang.String getFileURLRelativeTo(java.lang.String url,
java.lang.String base)
LagoonContext
getFileURLRelativeTo in interface LagoonContexturl - URL to the file, if relative it's searched for relative to
the base parameter.base - base URL, must be pseudo-absolute
public java.lang.String getProperty(java.lang.String key)
LagoonContext
getProperty in interface LagoonContextkey - the property name
null if the property is
not defined.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||