|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.ServletContextAware
public 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 Store
public boolean isSecure()
Store
isSecure
in interface Store
public boolean exists()
Store
exists
in interface Store
public boolean hasDocument(String documentPath)
Store
hasDocument
in interface Store
documentPath
- document path
public long lastModified(String documentPath) throws IOException
Store
lastModified
in interface Store
documentPath
- document path to an existing document
IOException
- if the document does not exist in the storepublic void updateDocument(String documentPath, String content) throws IOException
Store
updateDocument
in interface Store
documentPath
- document pathcontent
- content to update the document with
IOException
- if the document does not exist or the update failspublic boolean removeDocument(String documentPath) throws IOException
Store
removeDocument
in interface Store
documentPath
- document path
IOException
- if the document does not exist or the remove failspublic void createDocument(String documentPath, String content) throws IOException
Store
createDocument
in interface Store
documentPath
- document pathcontent
- content of the document to write
IOException
- if the document already exists or the create failspublic InputStream getDocument(String documentPath) throws IOException
Store
getDocument
in interface Store
documentPath
- 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 Store
path
- 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 Store
public String[] getScriptDocumentPaths(WebScript script)
Store
getScriptDocumentPaths
in interface Store
script
- web script
public ScriptLoader getScriptLoader()
Store
getScriptLoader
in interface Store
public freemarker.cache.TemplateLoader getTemplateLoader()
Store
getTemplateLoader
in interface Store
public String getBasePath()
Store
getBasePath
in interface Store
public 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 |