org.carrot2.util.resource
Class ClassResource

java.lang.Object
  extended by org.carrot2.util.resource.URLResource
      extended by org.carrot2.util.resource.ClassResource
All Implemented Interfaces:
IResource

public final class ClassResource
extends URLResource

A resource relative to a class. This resource provider caches the content of returned resources and closes the stream handle in open().


Constructor Summary
ClassResource(Class<?> clazz, String resource)
           
 
Method Summary
 InputStream open()
          Override the default open-from-URL method so that we don't lock the source JAR.
 
Methods inherited from class org.carrot2.util.resource.URLResource
equals, getUrl, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassResource

public ClassResource(Class<?> clazz,
                     String resource)
Method Detail

open

public InputStream open()
                 throws IOException
Override the default open-from-URL method so that we don't lock the source JAR.

Specified by:
open in interface IResource
Overrides:
open in class URLResource
Throws:
IOException


Copyright (c) Dawid Weiss, Stanislaw Osinski