All Known Implementing Classes:
AbstractStore, ClassPathStore, RemoteStore

public interface Store
Store for holding Web Script Definitions and Implementations
Author:
davidc
  • Method Details

    • init

      void init()
      Initialise Store (called once)
    • exists

      boolean exists()
      Determines whether the store actually exists
      Returns:
      true => it does exist
    • getBasePath

      String getBasePath()
      Gets the base path of the store
      Returns:
      base path
    • isSecure

      boolean isSecure()
      Returns true if this store is considered secure - i.e. on the app-server classpath. Scripts in secure stores can be run under the identity of a declared user (via the runas attribute) rather than the authenticated user.
      Returns:
      true if this store is considered secure
    • getDocumentPaths

      String[] getDocumentPaths(String path, boolean includeSubPaths, String documentPattern) throws IOException
      Gets the paths of given document pattern within given path/sub-paths in this store
      Parameters:
      path - start path
      includeSubPaths - if true, include sub-paths
      documentPattern - document name, allows wildcards, eg. *.ftl or my*.ftl
      Returns:
      array of document paths
      Throws:
      IOException
    • getDocumentPaths

      String[] getDocumentPaths(String path, String filePathPattern) throws IOException
      Gets the paths matching a given file path pattern in this 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
      Throws:
      IOException
    • getDescriptionDocumentPaths

      String[] getDescriptionDocumentPaths() throws IOException
      Gets the paths of all Web Script description documents in this store
      Returns:
      array of description document paths
      Throws:
      IOException
    • getScriptDocumentPaths

      String[] getScriptDocumentPaths(WebScript script) throws IOException
      Gets the paths of all implementation files for a given Web Script
      Parameters:
      script - web script
      Returns:
      array of implementation document paths
      Throws:
      IOException
    • getAllDocumentPaths

      String[] getAllDocumentPaths()
      Gets the paths of all documents in this store
      Returns:
      array of all document paths
    • lastModified

      long lastModified(String documentPath) throws IOException
      Gets the last modified timestamp for the document.
      Parameters:
      documentPath - document path to an existing document
      Returns:
      last modified timestamp
      Throws:
      IOException - if the document does not exist in the store
    • hasDocument

      boolean hasDocument(String documentPath) throws IOException
      Determines if the document exists.
      Parameters:
      documentPath - document path
      Returns:
      true => exists, false => does not exist
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getDocument

      InputStream getDocument(String documentPath) throws IOException
      Gets a document. Note a raw InputStream to the content is returned and must be closed by the accessing method.
      Parameters:
      documentPath - document path
      Returns:
      input stream onto document
      Throws:
      IOException - if the document does not exist in the store
    • createDocument

      void createDocument(String documentPath, String content) throws IOException
      Creates a document.
      Parameters:
      documentPath - document path
      content - content of the document to write
      Throws:
      IOException - if the document already exists or the create fails
    • createDocuments

      void createDocuments(List<org.springframework.extensions.surf.util.Pair<String,org.dom4j.Document>> paths) throws IOException
      Creates multiple XML documents at the specified paths.
      Parameters:
      paths - list of path, document pairs
      Throws:
      IOException - if a document already exists or a create fails
    • updateDocument

      void updateDocument(String documentPath, String content) throws IOException
      Updates an existing document.
      Parameters:
      documentPath - document path
      content - content to update the document with
      Throws:
      IOException - if the document does not exist or the update fails
    • removeDocument

      boolean removeDocument(String documentPath) throws IOException
      Removes an existing document.
      Parameters:
      documentPath - document path
      Returns:
      whether the operation succeeded
      Throws:
      IOException - if the document does not exist or the remove fails
    • getTemplateLoader

      freemarker.cache.TemplateLoader getTemplateLoader()
      Gets the template loader for this store
      Returns:
      template loader
    • getScriptLoader

      ScriptLoader getScriptLoader()
      Gets the script loader for this store
      Returns:
      script loader
    • isReadOnly

      boolean isReadOnly()
      Indicates whether or not this store can be written to.
      Returns:
      true If the store cannot be written to and false otherwise.