org.gcube.common.scan.resources
Class JarEntryResource

java.lang.Object
  extended by org.gcube.common.scan.resources.JarEntryResource
All Implemented Interfaces:
ClasspathResource

public class JarEntryResource
extends Object
implements ClasspathResource


Constructor Summary
JarEntryResource(JarFile file, ZipEntry entry)
           
 
Method Summary
 File file()
          Returns the resource as a file
 String name()
          Returns the name of the resource.
 String path()
          Returns the path of the resource, relatively to the containing archive.
 InputStream stream()
          Returns the resource as a stream.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JarEntryResource

public JarEntryResource(JarFile file,
                        ZipEntry entry)
Method Detail

name

public String name()
Description copied from interface: ClasspathResource
Returns the name of the resource.

Specified by:
name in interface ClasspathResource
Returns:

path

public String path()
Description copied from interface: ClasspathResource
Returns the path of the resource, relatively to the containing archive.

Specified by:
path in interface ClasspathResource
Returns:

stream

public InputStream stream()
                   throws Exception
Description copied from interface: ClasspathResource
Returns the resource as a stream.

Specified by:
stream in interface ClasspathResource
Returns:
the stream
Throws:
Exception - if the stream cannot be returned

file

public File file()
          throws Exception
Description copied from interface: ClasspathResource
Returns the resource as a file

Specified by:
file in interface ClasspathResource
Returns:
the file
Throws:
Exception - if the file cannot be returned

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All Rights Reserved.