Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.core.io.supplier
Class DefaultInputSupplier

java.lang.Object
  extended by eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier
All Implemented Interfaces:
com.google.common.io.InputSupplier<InputStream>, Locatable, LocatableInputSupplier<InputStream>

public class DefaultInputSupplier
extends Object
implements LocatableInputSupplier<InputStream>

Default I/O supplier based on an URI

Since:
2.2
Author:
Simon Templer
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Field Summary
static String SCHEME_LOCAL
          Name of the scheme where resolving locally through Resources is preferred.
 
Constructor Summary
DefaultInputSupplier(URI location)
          Create a default I/O supplier based on the given URI
 
Method Summary
 boolean equals(Object obj)
           
 InputStream getInput()
           
 URI getLocation()
          Get the location
 int hashCode()
           
protected  InputStream resolve(URI location)
          Resolve the given location and open an input stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEME_LOCAL

public static final String SCHEME_LOCAL
Name of the scheme where resolving locally through Resources is preferred.

See Also:
Constant Field Values
Constructor Detail

DefaultInputSupplier

public DefaultInputSupplier(URI location)
Create a default I/O supplier based on the given URI

Parameters:
location - the location URI
Method Detail

getInput

public InputStream getInput()
                     throws IOException
Specified by:
getInput in interface com.google.common.io.InputSupplier<InputStream>
Throws:
IOException
See Also:
InputSupplier.getInput()

resolve

protected InputStream resolve(URI location)
                       throws IOException
Resolve the given location and open an input stream.

Parameters:
location - the location
Returns:
the input stream
Throws:
IOException - if an error occurs opening the stream

getLocation

public URI getLocation()
Description copied from interface: Locatable
Get the location

Specified by:
getLocation in interface Locatable
Returns:
the location, may be null
See Also:
Locatable.getLocation()

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d