Class ResourceWalker
java.lang.Object
org.apache.commons.io.DirectoryWalker<String>
clazzfish.monitor.internal.ResourceWalker
- Direct Known Subclasses:
ClassWalker
This class scans a sub directory for a given suffix. Originally it was
part of the PatternTesting project.
- Author:
- oliver
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.io.DirectoryWalker
org.apache.commons.io.DirectoryWalker.CancelException
-
Constructor Summary
ConstructorsConstructorDescriptionResourceWalker
(File dir) Instantiates a new Resource walker for all resources.ResourceWalker
(File dir, FileFilter filter) Instantiates a new Resource walker.ResourceWalker
(File dir, String suffix) Instantiates a new resource walker for resources with the given suffix. -
Method Summary
Modifier and TypeMethodDescriptionWalk thru the directories and return it as packages.Walk thru the directories and return all found file resources.protected boolean
handleDirectory
(File directory, int depth, Collection<String> results) Overridable callback method invoked to determine if a directory should be processed.protected void
handleFile
(File file, int depth, Collection<String> results) Handle file.Methods inherited from class org.apache.commons.io.DirectoryWalker
checkIfCancelled, filterDirectoryContents, handleCancelled, handleDirectoryEnd, handleDirectoryStart, handleEnd, handleIsCancelled, handleRestricted, handleStart, walk
-
Constructor Details
-
ResourceWalker
Instantiates a new Resource walker for all resources.- Parameters:
dir
- the start dir
-
ResourceWalker
-
ResourceWalker
Instantiates a new Resource walker.- Parameters:
dir
- the dirfilter
- the filter
-
-
Method Details
-
getResources
Walk thru the directories and return all found file resources.- Returns:
- a collection of resources
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getPackages
Walk thru the directories and return it as packages.- Returns:
- the packages
- Throws:
IOException
- the io exception
-
handleFile
Handle file.- Overrides:
handleFile
in classorg.apache.commons.io.DirectoryWalker<String>
- Parameters:
file
- the filedepth
- the depthresults
- the results- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-
handleDirectory
protected boolean handleDirectory(File directory, int depth, Collection<String> results) throws IOException Overridable callback method invoked to determine if a directory should be processed.- Overrides:
handleDirectory
in classorg.apache.commons.io.DirectoryWalker<String>
- Parameters:
directory
- the current directory being processeddepth
- the current directory level (starting directory = 0)results
- the collection of result objects, may be updated- Returns:
- true to process this directory
- Throws:
IOException
- if an I/O Error occurs
-