Class SearchPath

  • All Implemented Interfaces:
    java.util.EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

    public class SearchPath
    extends java.lang.Object
    implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener
    Web Script Storage
    Author:
    davidc
    • Constructor Summary

      Constructors 
      Constructor Description
      SearchPath()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.InputStream getDocument​(java.lang.String documentPath)
      Gets a document from anywhere on the search path.
      Store getStore​(java.lang.String storePath)
      Gets the Web Script Store for the given Store path
      java.util.Collection<Store> getStores()
      Gets all Web Script Stores
      boolean hasDocument​(java.lang.String documentPath)
      Determines if the document exists anywhere on the search path
      void onApplicationEvent​(org.springframework.context.ApplicationEvent event)  
      void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)  
      void setSearchPath​(java.util.List<Store> searchPath)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SearchPath

        public SearchPath()
    • Method Detail

      • setSearchPath

        public void setSearchPath​(java.util.List<Store> searchPath)
        Parameters:
        searchPath - List
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • onApplicationEvent

        public void onApplicationEvent​(org.springframework.context.ApplicationEvent event)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener
      • getStores

        public java.util.Collection<Store> getStores()
        Gets all Web Script Stores
        Returns:
        all Web Script Stores
      • getStore

        public Store getStore​(java.lang.String storePath)
        Gets the Web Script Store for the given Store path
        Parameters:
        storePath - String
        Returns:
        store (or null, if not found)
      • hasDocument

        public boolean hasDocument​(java.lang.String documentPath)
                            throws java.io.IOException
        Determines if the document exists anywhere on the search path
        Parameters:
        documentPath - document path
        Returns:
        true => exists, false => does not exist
        Throws:
        java.io.IOException
      • getDocument

        public java.io.InputStream getDocument​(java.lang.String documentPath)
                                        throws java.io.IOException
        Gets a document from anywhere on the search path. 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 or null if it does not exist on the search path
        Throws:
        java.io.IOException