org.skife.jdbi.tweak
Class ChainedScriptLocator

java.lang.Object
  extended by org.skife.jdbi.tweak.ChainedScriptLocator
All Implemented Interfaces:
ScriptLocator

public class ChainedScriptLocator
extends java.lang.Object
implements ScriptLocator

Will take a group of script locators and try each, in order, until one finds the requested resource.


Constructor Summary
ChainedScriptLocator(ScriptLocator[] locators)
           
 
Method Summary
 java.io.InputStream locate(java.lang.String name)
          Tries each ScriptLocator passed to the constructor in order, returning from the first which actually finds the requested resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainedScriptLocator

public ChainedScriptLocator(ScriptLocator[] locators)
Method Detail

locate

public java.io.InputStream locate(java.lang.String name)
                           throws java.lang.Exception
Tries each ScriptLocator passed to the constructor in order, returning from the first which actually finds the requested resource.

Specified by:
locate in interface ScriptLocator
Parameters:
name - Resource name to look for. This will be the raw value requested by the client.
Returns:
open input stream, or null if nothing could be found.
Throws:
java.lang.Exception - if anything goes wrong locating the statement, will be wrapped in a DBIException and rethrown