|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.extensions.webscripts.AbstractStore
org.springframework.extensions.webscripts.LocalFileSystemStore
public class LocalFileSystemStore
Simple implementation of a local store file system. This is extremely light weight and is used as a base case for comparing other store performance vs. the local file system.
| Nested Class Summary | |
|---|---|
protected class |
LocalFileSystemStore.LocalFileSystemStoreScriptLoader
Local File System Store implementation of a Script Loader |
| Constructor Summary | |
|---|---|
LocalFileSystemStore()
|
|
| Method Summary | |
|---|---|
void |
createDocument(String documentPath,
String content)
Creates a document. |
boolean |
exists()
Determines whether the store actually exists |
protected void |
gatherAbsolutePaths(String absPath,
List<String> list)
|
String[] |
getAllDocumentPaths()
Gets the paths of all documents in this store |
String |
getBasePath()
Gets the base path of the store |
String[] |
getDescriptionDocumentPaths()
Gets the paths of all Web Script description documents in this store |
InputStream |
getDocument(String documentPath)
Gets a document |
String[] |
getDocumentPaths(String path,
boolean includedSubPaths,
String documentPattern)
Gets the paths of given document pattern within given path/sub-paths in this store |
protected String[] |
getDocumentPathsByRegEx(String path,
String regexPattern,
boolean traverseChildren)
Performs a pattern filter look up using a regex and starting from a given path. |
String |
getPath()
|
String |
getRealPath(String path)
Helper function for converting a web application path to a real system path. |
String |
getRoot()
|
protected File |
getRootDir()
|
String[] |
getScriptDocumentPaths(WebScript script)
Gets the paths of all implementation files for a given Web Script |
ScriptLoader |
getScriptLoader()
Gets the script loader for this store |
javax.servlet.ServletContext |
getServletContext()
|
freemarker.cache.TemplateLoader |
getTemplateLoader()
Gets the template loader for this store |
boolean |
hasDocument(String documentPath)
Determines if the document exists. |
void |
init()
Initialise Store (called once) |
boolean |
isSecure()
Returns true if this store is considered secure - i.e. |
long |
lastModified(String documentPath)
Gets the last modified timestamp for the document. |
boolean |
removeDocument(String documentPath)
Removes an existing document. |
void |
setPath(String path)
|
void |
setRoot(String root)
|
void |
setServletContext(javax.servlet.ServletContext servletContext)
|
protected String |
toAbsolutePath(String documentPath)
Returns the absolute path relative to the root of the store given a particular document path. |
void |
updateDocument(String documentPath,
String content)
Updates an existing document. |
| Methods inherited from class org.springframework.extensions.webscripts.AbstractStore |
|---|
getDocumentPaths, getPreviewContext, setPreviewContextProvider |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LocalFileSystemStore()
| Method Detail |
|---|
public void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext in interface org.springframework.web.context.ServletContextAwarepublic javax.servlet.ServletContext getServletContext()
protected File getRootDir()
public void setRoot(String root)
root - the root pathpublic String getRoot()
public void setPath(String path)
path - the relative path to setpublic String getPath()
public void init()
Store
init in interface Storepublic boolean isSecure()
Store
isSecure in interface Storepublic boolean exists()
Store
exists in interface Storepublic boolean hasDocument(String documentPath)
Store
hasDocument in interface StoredocumentPath - document path
public long lastModified(String documentPath)
throws IOException
Store
lastModified in interface StoredocumentPath - document path to an existing document
IOException - if the document does not exist in the store
public void updateDocument(String documentPath,
String content)
throws IOException
Store
updateDocument in interface StoredocumentPath - document pathcontent - content to update the document with
IOException - if the document does not exist or the update fails
public boolean removeDocument(String documentPath)
throws IOException
Store
removeDocument in interface StoredocumentPath - document path
IOException - if the document does not exist or the remove fails
public void createDocument(String documentPath,
String content)
throws IOException
Store
createDocument in interface StoredocumentPath - document pathcontent - content of the document to write
IOException - if the document already exists or the create fails
public InputStream getDocument(String documentPath)
throws IOException
Store
getDocument in interface StoredocumentPath - document path
IOException - if the document does not exist in the storepublic String[] getAllDocumentPaths()
Store
getAllDocumentPaths in interface Store
public String[] getDocumentPaths(String path,
boolean includedSubPaths,
String documentPattern)
Store
getDocumentPaths in interface Storepath - start pathincludedSubPaths - if true, include sub-pathsdocumentPattern - document name, allows wildcards, eg. *.ftl or my*.ftl
protected String[] getDocumentPathsByRegEx(String path,
String regexPattern,
boolean traverseChildren)
path - regexPattern - traverseChildren -
public String[] getDescriptionDocumentPaths()
Store
getDescriptionDocumentPaths in interface Storepublic String[] getScriptDocumentPaths(WebScript script)
Store
getScriptDocumentPaths in interface Storescript - web script
public ScriptLoader getScriptLoader()
Store
getScriptLoader in interface Storepublic freemarker.cache.TemplateLoader getTemplateLoader()
Store
getTemplateLoader in interface Storepublic String getBasePath()
Store
getBasePath in interface Storepublic String getRealPath(String path)
path - the relative path
protected String toAbsolutePath(String documentPath)
documentPath -
protected void gatherAbsolutePaths(String absPath,
List<String> list)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||