|
||||||||||
| 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.ClassPathStore
public class ClassPathStore
ClassPath based Web Script Store
| Field Summary | |
|---|---|
protected String |
classPath
|
protected boolean |
mustExist
|
protected File |
storeDir
|
protected org.springframework.core.io.Resource |
storeResource
|
protected String |
storeResourcePath
|
protected int |
storeResourcePathLength
|
| Constructor Summary | |
|---|---|
ClassPathStore()
|
|
| Method Summary | |
|---|---|
void |
createDocument(String documentPath,
String content)
Creates a document. |
static String |
createPath(String path,
String relativePath)
Helper method for creating relative paths |
boolean |
exists()
Determines whether the store actually exists |
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 includeSubPaths,
String documentPattern)
Gets the paths of given document pattern within given path/sub-paths in this store |
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 |
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 |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
void |
setClassPath(String classPath)
Sets the class path |
void |
setMustExist(boolean mustExist)
Sets whether the class path must exist If it must exist, but it doesn't exist, an exception is thrown on initialisation of the store |
String |
toString()
|
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, wait, wait, wait |
| Methods inherited from interface org.springframework.extensions.webscripts.Store |
|---|
getDocumentPaths |
| Field Detail |
|---|
protected boolean mustExist
protected String classPath
protected org.springframework.core.io.Resource storeResource
protected String storeResourcePath
protected int storeResourcePathLength
protected File storeDir
| Constructor Detail |
|---|
public ClassPathStore()
| Method Detail |
|---|
public void setMustExist(boolean mustExist)
mustExist - public void setClassPath(String classPath)
classPath - classpath
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void init()
Store
init in interface Storepublic boolean exists()
Store
exists in interface Storepublic String getBasePath()
Store
getBasePath in interface Storepublic boolean isSecure()
Store
isSecure in interface Storepublic String[] getAllDocumentPaths()
Store
getAllDocumentPaths in interface Store
public String[] getDocumentPaths(String path,
boolean includeSubPaths,
String documentPattern)
throws IOException
Store
getDocumentPaths in interface Storepath - start pathincludeSubPaths - if true, include sub-pathsdocumentPattern - document name, allows wildcards, eg. *.ftl or my*.ftl
IOException
public String[] getDescriptionDocumentPaths()
throws IOException
Store
getDescriptionDocumentPaths in interface StoreIOException
public String[] getScriptDocumentPaths(WebScript script)
throws IOException
Store
getScriptDocumentPaths in interface Storescript - web script
IOException
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 storepublic boolean hasDocument(String documentPath)
Store
hasDocument in interface StoredocumentPath - document path
public InputStream getDocument(String documentPath)
throws IOException
Store
getDocument in interface StoredocumentPath - document path
IOException - if the document does not exist in the store
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 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 failspublic freemarker.cache.TemplateLoader getTemplateLoader()
Store
getTemplateLoader in interface Storepublic ScriptLoader getScriptLoader()
Store
getScriptLoader in interface Store
public static String createPath(String path,
String relativePath)
path - relativePath -
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||