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 files)
          Scan from a set of packages.
FilesScanner(String[] fileNames)
          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 files)
Scan from a set of packages.

Parameters:
files - a String containing package names.

FilesScanner

public FilesScanner(String[] fileNames)
Scan from a set of packages.

Parameters:
fileNames - an array of package names.
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-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.