Class JarFileScanner
java.lang.Object
org.glassfish.jersey.server.internal.AbstractResourceFinderAdapter
org.glassfish.jersey.server.internal.scanning.JarFileScanner
- All Implemented Interfaces:
AutoCloseable
,Iterator<String>
,ResourceFinder
A utility class that scans entries in jar files.
- Author:
- Paul Sandoz
-
Constructor Summary
ConstructorDescriptionJarFileScanner
(InputStream inputStream, String parent, boolean recursive) Create new JAR file scanner. -
Method Summary
Methods inherited from class org.glassfish.jersey.server.internal.AbstractResourceFinderAdapter
remove
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
JarFileScanner
Create new JAR file scanner.- Parameters:
inputStream
- JAR file input streamparent
- JAR file entry prefix.recursive
- if (true
the packages will be scanned recursively together with any nested packages, iffalse
only the explicitly listed packages will be scanned.- Throws:
IOException
- if wrapping given input stream intoJarInputStream
failed.
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
reset
public void reset()Description copied from interface:ResourceFinder
Reset theResourceFinder
instance. Upon calling this method the implementing class MUST reset its internal state to the initial state. -
open
Description copied from interface:ResourceFinder
Open current resource.- Returns:
- input stream from which current resource can be loaded.
-
close
public void close()Description copied from class:AbstractResourceFinderAdapter
Default implementation of#close()
which does nothing.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceResourceFinder
- Overrides:
close
in classAbstractResourceFinderAdapter
-