Class 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 Detail

      • DESC_PATH_PATTERN

        public static final java.lang.String DESC_PATH_PATTERN
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractStore

        public AbstractStore()
    • 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:
        isReadOnly in interface Store
        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.IOException
        Description copied from interface: Store
        Creates multiple XML documents at the specified paths.
        Specified by:
        createDocuments in interface Store
        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: Store
        Gets the paths matching a given file path pattern in this store.
        Specified by:
        getDocumentPaths in interface Store
        Parameters:
        path - start path
        filePathPattern - file path pattern string, allows wildcards, eg. *.ftl or my*.ftl or *\/a\/*.xml
        Returns:
        array of document paths