Class FilesScanner
java.lang.Object
org.glassfish.jersey.server.internal.AbstractResourceFinderAdapter
org.glassfish.jersey.server.internal.scanning.FilesScanner
- All Implemented Interfaces:
AutoCloseable, Iterator<String>, ResourceFinder
A scanner that recursively scans directories and jar files.
Files or jar entries are reported to a
ResourceProcessor.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CompositeResourceFinderprivate final File[]private final boolean -
Constructor Summary
ConstructorsConstructorDescriptionFilesScanner(String[] fileNames, boolean recursive) Scan from a set of packages. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Default implementation of#close()which does nothing.booleanhasNext()private voidinit()next()open()Open current resource.private voidprocessFile(File f) voidreset()Reset theResourceFinderinstance.Methods inherited from class AbstractResourceFinderAdapter
removeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining
-
Field Details
-
files
-
recursive
private final boolean recursive -
compositeResourceFinder
-
-
Constructor Details
-
FilesScanner
Scan from a set of packages.- Parameters:
fileNames- an array of package names.recursive- flag indicating whether sub-directories of any directories in the list of files should be included in the scanning (true) or not (false).
-
-
Method Details
-
processFile
-
hasNext
public boolean hasNext() -
next
-
open
Description copied from interface:ResourceFinderOpen current resource.- Returns:
- input stream from which current resource can be loaded.
-
close
public void close()Description copied from class:AbstractResourceFinderAdapterDefault implementation of#close()which does nothing.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceResourceFinder- Overrides:
closein classAbstractResourceFinderAdapter
-
reset
public void reset()Description copied from interface:ResourceFinderReset theResourceFinderinstance. Upon calling this method the implementing class MUST reset its internal state to the initial state. -
init
private void init()
-