Class SearchPath
- java.lang.Object
-
- org.springframework.extensions.webscripts.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.ApplicationListenerWeb 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.InputStreamgetDocument(java.lang.String documentPath)Gets a document from anywhere on the search path.StoregetStore(java.lang.String storePath)Gets the Web Script Store for the given Store pathjava.util.Collection<Store>getStores()Gets all Web Script StoresbooleanhasDocument(java.lang.String documentPath)Determines if the document exists anywhere on the search pathvoidonApplicationEvent(org.springframework.context.ApplicationEvent event)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetSearchPath(java.util.List<Store> 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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
- Specified by:
onApplicationEventin interfaceorg.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.IOExceptionDetermines 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.IOExceptionGets 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
-
-