|
||||||||||
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.JarStore
public class JarStore
Read only store implementation that can be mounted against a JAR file. Works against the contents of the JAR file beginning at a specified path. This is used to prepackage assets into JAR files for ease of build and distribution into external web applications (via Maven). As with any Store, the interface methods deal principally with document paths. Document paths are assumed to be relative to the root path. In this case, all of the JAR file entries under the root path are considered to be Store contents. The paths to these jar entries are determined by combining the root path with the document path. An example of a relative path: org/alfresco/web/example/template.ftl An example of an absolute path: META-INF/org/alfresco/web/example/template.ftl Where the root path is "META-INF/"
Field Summary | |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext
|
protected List<String> |
documents
|
protected boolean |
exists
|
static String |
JAR_PROTOCOL
|
protected String |
jarAutoDiscoveryClassPath
|
protected String |
jarPath
|
protected boolean |
mustExist
|
protected String |
rootPath
|
protected javax.servlet.ServletContext |
servletContext
|
Constructor Summary | |
---|---|
JarStore()
|
Method Summary | |
---|---|
void |
createDocument(String documentPath,
String content)
Creates a document. |
boolean |
exists()
Determines whether the store actually exists |
String[] |
getAllDocumentPaths()
Gets the paths of all documents in this store |
org.springframework.context.ApplicationContext |
getApplicationContext()
Gets the application context. |
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 |
getJarAutoDiscoveryClassPath()
Gets the jar auto discovery class path. |
protected JarFile |
getJarFile()
Gets the jar file. |
String |
getJarPath()
Gets the jar path. |
String |
getRootPath()
Gets the root path. |
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 |
setAllowedResourcePaths(List<String> allowedResourcePaths)
Sets the allowed resource paths. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Sets the application context. |
void |
setJarAutoDiscoveryClassPath(String jarAutoDiscoveryClassPath)
Sets the jar auto discovery path. |
void |
setJarPath(String jarPath)
Sets the jar 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 |
void |
setRootPath(String rootPath)
Sets the root path |
void |
setServletContext(javax.servlet.ServletContext servletContext)
|
protected String |
toAbsolutePath(String relativePath)
To absolute path. |
protected String |
toRelativePath(String fullPath)
To relative path. |
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 |
---|
public static final String JAR_PROTOCOL
protected boolean mustExist
protected boolean exists
protected String rootPath
protected String jarPath
protected String jarAutoDiscoveryClassPath
protected List<String> documents
protected javax.servlet.ServletContext servletContext
protected org.springframework.context.ApplicationContext applicationContext
Constructor Detail |
---|
public JarStore()
Method Detail |
---|
public void setAllowedResourcePaths(List<String> allowedResourcePaths)
allowedResourcePaths
- the new allowed resource pathspublic void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext
in interface org.springframework.web.context.ServletContextAware
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
applicationContext
- the new application contextpublic org.springframework.context.ApplicationContext getApplicationContext()
public void setJarAutoDiscoveryClassPath(String jarAutoDiscoveryClassPath)
jarAutoDiscoveryPath
- the new jar auto discovery pathpublic String getJarAutoDiscoveryClassPath()
public void setJarPath(String jarPath)
jarPath
- the new jar pathpublic String getJarPath()
public void setRootPath(String rootPath)
rootPath
- the new root pathpublic String getRootPath()
protected String toRelativePath(String fullPath)
fullPath
- the full path
protected String toAbsolutePath(String relativePath)
relativePath
- the relative path
public void setMustExist(boolean mustExist)
mustExist
- protected JarFile getJarFile()
public void init()
Store
init
in interface Store
public boolean exists()
Store
exists
in interface Store
public String getBasePath()
Store
getBasePath
in interface Store
public boolean isSecure()
Store
isSecure
in interface Store
public String[] getAllDocumentPaths()
Store
getAllDocumentPaths
in interface Store
public String[] getDescriptionDocumentPaths()
Store
getDescriptionDocumentPaths
in interface Store
public String[] getScriptDocumentPaths(WebScript script)
Store
getScriptDocumentPaths
in interface Store
script
- web script
public String[] getDocumentPaths(String path, boolean includeSubPaths, String documentPattern)
Store
getDocumentPaths
in interface Store
path
- start pathincludeSubPaths
- if true, include sub-pathsdocumentPattern
- document name, allows wildcards, eg. *.ftl or my*.ftl
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 boolean hasDocument(String documentPath)
Store
hasDocument
in interface Store
documentPath
- document path
public InputStream getDocument(String documentPath) throws IOException
Store
getDocument
in interface Store
documentPath
- document path
IOException
- if the document does not exist in the storepublic 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 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 freemarker.cache.TemplateLoader getTemplateLoader()
Store
getTemplateLoader
in interface Store
public ScriptLoader getScriptLoader()
Store
getScriptLoader
in interface Store
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |