ch.elca.el4j.core.io
Class ExplicitClassPathResource

java.lang.Object
  extended by org.springframework.core.io.AbstractResource
      extended by org.springframework.core.io.AbstractFileResolvingResource
          extended by org.springframework.core.io.ClassPathResource
              extended by ch.elca.el4j.core.io.ExplicitClassPathResource
All Implemented Interfaces:
InputStreamSource, Resource

public class ExplicitClassPathResource
extends ClassPathResource

This is an explicit class path resource. A normal class path resource has only a path that can point to multiple resources. By using the given url too this resource explicitly points to one resource.

Author:
Martin Zeltner (MZE)
File-location:
ExplicitClassPathResource
Last check-in date:
2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) by jonasha for revision 4010

Constructor Summary
ExplicitClassPathResource(URL url, String path, ClassLoader classLoader)
          Constructor with an explicit url for the given class path resource.
 
Method Summary
 boolean equals(Object obj)
          
 InputStream getInputStream()
           
 URL getURL()
           
 int hashCode()
           
 
Methods inherited from class org.springframework.core.io.ClassPathResource
createRelative, exists, getClassLoader, getDescription, getFilename, getPath
 
Methods inherited from class org.springframework.core.io.AbstractFileResolvingResource
contentLength, getFile, getFile, getFileForLastModifiedCheck, isReadable, lastModified
 
Methods inherited from class org.springframework.core.io.AbstractResource
getURI, isOpen, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExplicitClassPathResource

public ExplicitClassPathResource(URL url,
                                 String path,
                                 ClassLoader classLoader)
Constructor with an explicit url for the given class path resource.

Parameters:
url - The explicit url for this class path resource.
path - The path to get this resource from class loader. This path can return a different resource than the given url points to.
classLoader - The class loader used to load the given url.
Method Detail

getURL

public URL getURL()
           throws IOException
Specified by:
getURL in interface Resource
Overrides:
getURL in class ClassPathResource
Returns:
Returns the explicit url for this class path resource.
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Specified by:
getInputStream in interface InputStreamSource
Overrides:
getInputStream in class ClassPathResource
Returns:
Returns the input stream of the given url.
Throws:
IOException

equals

public boolean equals(Object obj)

Overrides:
equals in class ClassPathResource

hashCode

public int hashCode()
Overrides:
hashCode in class ClassPathResource


Copyright © 2005-2011 ELCA. All Rights Reserved.