Class AbstractStore
- java.lang.Object
-
- org.springframework.extensions.webscripts.AbstractStore
-
- All Implemented Interfaces:
Store
- Direct Known Subclasses:
ClassPathStore,RemoteStore
public abstract class AbstractStore extends java.lang.Object implements Store
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 Modifier and Type Field Description static java.lang.StringDESC_PATH_PATTERN
-
Constructor Summary
Constructors Constructor Description AbstractStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateDocuments(java.util.List<org.springframework.extensions.surf.util.Pair<java.lang.String,org.dom4j.Document>> pathContents)Creates multiple XML documents at the specified paths.java.lang.String[]getDocumentPaths(java.lang.String path, java.lang.String filePathPattern)Gets the paths matching a given file path pattern in this store.PreviewContextgetPreviewContext()Gets the preview contextbooleanisReadOnly()Whether 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, wait
-
Methods 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 Detail
-
DESC_PATH_PATTERN
public static final java.lang.String DESC_PATH_PATTERN
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public void setPreviewContextProvider(PreviewContextProvider previewContextProvider)
Sets the preview context provider- Parameters:
previewContextProvider- PreviewContextProvider
-
getPreviewContext
public PreviewContext getPreviewContext()
Gets the preview context- Returns:
- preview context
-
createDocuments
public void createDocuments(java.util.List<org.springframework.extensions.surf.util.Pair<java.lang.String,org.dom4j.Document>> pathContents) throws java.io.IOExceptionDescription copied from interface:StoreCreates multiple XML documents at the specified paths.- Specified by:
createDocumentsin interfaceStore- Parameters:
pathContents- list of path, document pairs- Throws:
java.io.IOException- if a document already exists or a create fails
-
getDocumentPaths
public java.lang.String[] getDocumentPaths(java.lang.String path, java.lang.String filePathPattern)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
-
-