Class AbstractStore
java.lang.Object
org.springframework.extensions.webscripts.AbstractStore
- All Implemented Interfaces:
Store
- Direct Known Subclasses:
ClassPathStore,RemoteStore
Abstract store class provided as a convenience for developers
who wish to build their own custom Store implementations for use
with the Web Script framework.
- Author:
- muzquiano
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateDocuments(List<org.springframework.extensions.surf.util.Pair<String, org.dom4j.Document>> pathContents) Creates multiple XML documents at the specified paths.String[]getDocumentPaths(String path, String filePathPattern) Gets the paths matching a given file path pattern in this store.Gets the preview contextbooleanWhether the store is in read-only modevoidsetPreviewContextProvider(PreviewContextProvider previewContextProvider) Sets the preview context providervoidsetReadOnly(boolean readOnly) Sets whether the class path store is to operate in read-only mode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.extensions.webscripts.Store
createDocument, exists, getAllDocumentPaths, getBasePath, getDescriptionDocumentPaths, getDocument, getDocumentPaths, getScriptDocumentPaths, getScriptLoader, getTemplateLoader, hasDocument, init, isSecure, lastModified, removeDocument, updateDocument
-
Field Details
-
DESC_PATH_PATTERN
- See Also:
-
-
Constructor Details
-
AbstractStore
public AbstractStore()
-
-
Method Details
-
setReadOnly
public void setReadOnly(boolean readOnly) Sets whether the class path store is to operate in read-only mode. Read only prevents users from performing creates, updates and removes- Parameters:
readOnly- boolean
-
isReadOnly
public boolean isReadOnly()Whether the store is in read-only mode- Specified by:
isReadOnlyin interfaceStore- Returns:
- boolean
-
setPreviewContextProvider
Sets the preview context provider- Parameters:
previewContextProvider- PreviewContextProvider
-
getPreviewContext
Gets the preview context- Returns:
- preview context
-
createDocuments
public void createDocuments(List<org.springframework.extensions.surf.util.Pair<String, org.dom4j.Document>> pathContents) throws IOExceptionDescription copied from interface:StoreCreates multiple XML documents at the specified paths.- Specified by:
createDocumentsin interfaceStore- Parameters:
pathContents- list of path, document pairs- Throws:
IOException- if a document already exists or a create fails
-
getDocumentPaths
Description copied from interface:StoreGets the paths matching a given file path pattern in this store.- Specified by:
getDocumentPathsin interfaceStore- Parameters:
path- start pathfilePathPattern- file path pattern string, allows wildcards, eg. *.ftl or my*.ftl or *\/a\/*.xml- Returns:
- array of document paths
-