org.springframework.extensions.webscripts
Class SearchPath

java.lang.Object
  extended by org.springframework.extensions.webscripts.SearchPath
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

public class SearchPath
extends Object
implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

Web Script Storage

Author:
davidc

Constructor Summary
SearchPath()
           
 
Method Summary
 InputStream getDocument(String documentPath)
          Gets a document from anywhere on the search path
 Store getStore(String storePath)
          Gets the Web Script Store for the given Store path
 Collection<Store> getStores()
          Gets all Web Script Stores
 boolean hasDocument(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(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(List<Store> searchPath)
Parameters:
searchPath -

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 Collection<Store> getStores()
Gets all Web Script Stores

Returns:
all Web Script Stores

getStore

public Store getStore(String storePath)
Gets the Web Script Store for the given Store path

Parameters:
storePath -
Returns:
store (or null, if not found)

hasDocument

public boolean hasDocument(String documentPath)
                    throws IOException
Determines if the document exists anywhere on the search path

Parameters:
documentPath - document path
Returns:
true => exists, false => does not exist
Throws:
IOException

getDocument

public InputStream getDocument(String documentPath)
                        throws IOException
Gets a document from anywhere on the search path

Parameters:
documentPath - document path
Returns:
input stream onto document or null if it does not exist on the search path
Throws:
IOException


Copyright © 2009 SpringSource, Inc. All Rights Reserved.