Top Fields Constructors Methods
com.sun.faces.application.resource

public Class ResourcePathsIterator

extends Object
implements Iterator<String>
Class Inheritance
All Implemented Interfaces
java.util.Iterator
Static Imports
com.sun.faces.util.Util.startsWithOneOf

Field Summary

Modifier and TypeField and Description
private final String[]
private final ExternalContext
private final int
private String
private final String[]
private final ArrayDeque<String>

Constructor Summary

AccessConstructor and Description
public
ResourcePathsIterator(String rootPath, int maxDepth, String[] extensions, String[] restrictedDirectories, ExternalContext externalContext)

Method Summary

Modifier and TypeMethod and Description
private static boolean
directoryExceedsMaxDepth(final String resourcePath, final long max)

public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
private static boolean

Returns:

true if the resource path represents a directory, false otherwise
isDirectory
(final String
the resource path to check
resourcePath
)

Checks if the given resource path obtained from ServletContext#getResourcePaths(String) represents a directory.

private static boolean
isValidCandidate(final String resourcePath, final String[] extensions)

public String
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
private void
private void
visit(String resourcePath)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

extensionsback to summary
private final String[] extensions
externalContextback to summary
private final ExternalContext externalContext
maxDepthback to summary
private final int maxDepth
nextback to summary
private String next
restrictedDirectoriesback to summary
private final String[] restrictedDirectories
stackback to summary
private final ArrayDeque<String> stack

Constructor Detail

ResourcePathsIteratorback to summary
public ResourcePathsIterator(String rootPath, int maxDepth, String[] extensions, String[] restrictedDirectories, ExternalContext externalContext)

Method Detail

directoryExceedsMaxDepthback to summary
private static boolean directoryExceedsMaxDepth(final String resourcePath, final long max)
hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
isDirectoryback to summary
private static boolean isDirectory(final String resourcePath)

Checks if the given resource path obtained from ServletContext#getResourcePaths(String) represents a directory.

Parameters
resourcePath:String

the resource path to check

Returns:boolean

true if the resource path represents a directory, false otherwise

isValidCandidateback to summary
private static boolean isValidCandidate(final String resourcePath, final String[] extensions)
nextback to summary
public String next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:String

the next element in the iteration

Annotations
@Override
tryTakeback to summary
private void tryTake()
visitback to summary
private void visit(String resourcePath)