org.glassfish.jersey.server.internal.scanning
Class FilesScanner

java.lang.Object
  extended by org.glassfish.jersey.server.internal.scanning.FilesScanner
All Implemented Interfaces:
Iterator<String>, ResourceFinder

public class FilesScanner
extends Object
implements ResourceFinder

A scanner that recursively scans directories and jar files. Files or jar entries are reported to a ResourceProcessor.

Author:
Paul Sandoz

Constructor Summary
FilesScanner(String[] fileNames, boolean recursive)
          Scan from a set of packages.
 
Method Summary
 boolean hasNext()
           
 String next()
           
 InputStream open()
          Open current resource.
 void remove()
          

This operation is not supported by ResourceFinder & throws UnsupportedOperationException when invoked.

 void reset()
          Reset the ResourceFinder instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilesScanner

public FilesScanner(String[] fileNames,
                    boolean recursive)
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 Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<String>

next

public String next()
Specified by:
next in interface Iterator<String>

remove

public void remove()
Description copied from interface: ResourceFinder

This operation is not supported by ResourceFinder & throws UnsupportedOperationException when invoked.

Specified by:
remove in interface Iterator<String>
Specified by:
remove in interface ResourceFinder

open

public InputStream open()
Description copied from interface: ResourceFinder
Open current resource.

Specified by:
open in interface ResourceFinder
Returns:
input stream from which current resource can be loaded.

reset

public void reset()
Description copied from interface: ResourceFinder
Reset the ResourceFinder instance.

Upon calling this method the implementing class MUST reset its internal state to the initial state.

Specified by:
reset in interface ResourceFinder


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.