123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!-- NewPage -->
- <html lang="de">
- <head>
- <!-- Generated by javadoc -->
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>DirectoryWalker (Apache Commons IO 2.6 API)</title>
- <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
- <script type="text/javascript" src="../../../../script.js"></script>
- </head>
- <body>
- <script type="text/javascript"><!--
- try {
- if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="DirectoryWalker (Apache Commons IO 2.6 API)";
- }
- }
- catch(err) {
- }
- //-->
- var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10};
- var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
- var altColor = "altColor";
- var rowColor = "rowColor";
- var tableTab = "tableTab";
- var activeTableTab = "activeTableTab";
- </script>
- <noscript>
- <div>JavaScript is disabled on your browser.</div>
- </noscript>
- <!-- ========= START OF TOP NAVBAR ======= -->
- <div class="topNav"><a name="navbar.top">
- <!-- -->
- </a>
- <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
- <a name="navbar.top.firstrow">
- <!-- -->
- </a>
- <ul class="navList" title="Navigation">
- <li><a href="../../../../overview-summary.html">Overview</a></li>
- <li><a href="package-summary.html">Package</a></li>
- <li class="navBarCell1Rev">Class</li>
- <li><a href="class-use/DirectoryWalker.html">Use</a></li>
- <li><a href="package-tree.html">Tree</a></li>
- <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
- <li><a href="../../../../index-all.html">Index</a></li>
- <li><a href="../../../../help-doc.html">Help</a></li>
- </ul>
- </div>
- <div class="subNav">
- <ul class="navList">
- <li><a href="../../../../org/apache/commons/io/CopyUtils.html" title="class in org.apache.commons.io"><span class="typeNameLink">Prev Class</span></a></li>
- <li><a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><span class="typeNameLink">Next Class</span></a></li>
- </ul>
- <ul class="navList">
- <li><a href="../../../../index.html?org/apache/commons/io/DirectoryWalker.html" target="_top">Frames</a></li>
- <li><a href="DirectoryWalker.html" target="_top">No Frames</a></li>
- </ul>
- <ul class="navList" id="allclasses_navbar_top">
- <li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
- </ul>
- <div>
- <script type="text/javascript"><!--
- allClassesLink = document.getElementById("allclasses_navbar_top");
- if(window==top) {
- allClassesLink.style.display = "block";
- }
- else {
- allClassesLink.style.display = "none";
- }
- //-->
- </script>
- </div>
- <div>
- <ul class="subNavList">
- <li>Summary: </li>
- <li><a href="#nested.class.summary">Nested</a> | </li>
- <li>Field | </li>
- <li><a href="#constructor.summary">Constr</a> | </li>
- <li><a href="#method.summary">Method</a></li>
- </ul>
- <ul class="subNavList">
- <li>Detail: </li>
- <li>Field | </li>
- <li><a href="#constructor.detail">Constr</a> | </li>
- <li><a href="#method.detail">Method</a></li>
- </ul>
- </div>
- <a name="skip.navbar.top">
- <!-- -->
- </a></div>
- <!-- ========= END OF TOP NAVBAR ========= -->
- <!-- ======== START OF CLASS DATA ======== -->
- <div class="header">
- <div class="subTitle">org.apache.commons.io</div>
- <h2 title="Class DirectoryWalker" class="title">Class DirectoryWalker<T></h2>
- </div>
- <div class="contentContainer">
- <ul class="inheritance">
- <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
- <li>
- <ul class="inheritance">
- <li>org.apache.commons.io.DirectoryWalker<T></li>
- </ul>
- </li>
- </ul>
- <div class="description">
- <ul class="blockList">
- <li class="blockList">
- <hr>
- <br>
- <pre>public abstract class <span class="typeNameLabel">DirectoryWalker<T></span>
- extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
- <div class="block">Abstract class that walks through a directory hierarchy and provides
- subclasses with convenient hooks to add specific behaviour.
- <p>
- This class operates with a <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io"><code>FileFilter</code></a> and maximum depth to
- limit the files and directories visited.
- Commons IO supplies many common filter implementations in the
- <a href="filefilter/package-summary.html"> filefilter</a> package.
- <p>
- The following sections describe:
- <ul>
- <li><a href="#example">1. Example Implementation</a> - example
- <code>FileCleaner</code> implementation.</li>
- <li><a href="#filter">2. Filter Example</a> - using
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io"><code>FileFilter</code></a>(s) with <code>DirectoryWalker</code>.</li>
- <li><a href="#cancel">3. Cancellation</a> - how to implement cancellation
- behaviour.</li>
- </ul>
- <a name="example"></a>
- <h3>1. Example Implementation</h3>
- There are many possible extensions, for example, to delete all
- files and '.svn' directories, and return a list of deleted files:
- <pre>
- public class FileCleaner extends DirectoryWalker {
- public FileCleaner() {
- super();
- }
- public List clean(File startDirectory) {
- List results = new ArrayList();
- walk(startDirectory, results);
- return results;
- }
- protected boolean handleDirectory(File directory, int depth, Collection results) {
- // delete svn directories and then skip
- if (".svn".equals(directory.getName())) {
- directory.delete();
- return false;
- } else {
- return true;
- }
- }
- protected void handleFile(File file, int depth, Collection results) {
- // delete file and add to list of deleted
- file.delete();
- results.add(file);
- }
- }
- </pre>
- <a name="filter"></a>
- <h3>2. Filter Example</h3>
- Choosing which directories and files to process can be a key aspect
- of using this class. This information can be setup in three ways,
- via three different constructors.
- <p>
- The first option is to visit all directories and files.
- This is achieved via the no-args constructor.
- <p>
- The second constructor option is to supply a single <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io"><code>FileFilter</code></a>
- that describes the files and directories to visit. Care must be taken
- with this option as the same filter is used for both directories
- and files.
- <p>
- For example, if you wanted all directories which are not hidden
- and files which end in ".txt":
- <pre>
- public class FooDirectoryWalker extends DirectoryWalker {
- public FooDirectoryWalker(FileFilter filter) {
- super(filter, -1);
- }
- }
- // Build up the filters and create the walker
- // Create a filter for Non-hidden directories
- IOFileFilter fooDirFilter =
- FileFilterUtils.andFileFilter(FileFilterUtils.directoryFileFilter,
- HiddenFileFilter.VISIBLE);
- // Create a filter for Files ending in ".txt"
- IOFileFilter fooFileFilter =
- FileFilterUtils.andFileFilter(FileFilterUtils.fileFileFilter,
- FileFilterUtils.suffixFileFilter(".txt"));
- // Combine the directory and file filters using an OR condition
- java.io.FileFilter fooFilter =
- FileFilterUtils.orFileFilter(fooDirFilter, fooFileFilter);
- // Use the filter to construct a DirectoryWalker implementation
- FooDirectoryWalker walker = new FooDirectoryWalker(fooFilter);
- </pre>
- <p>
- The third constructor option is to specify separate filters, one for
- directories and one for files. These are combined internally to form
- the correct <code>FileFilter</code>, something which is very easy to
- get wrong when attempted manually, particularly when trying to
- express constructs like 'any file in directories named docs'.
- <p>
- For example, if you wanted all directories which are not hidden
- and files which end in ".txt":
- <pre>
- public class FooDirectoryWalker extends DirectoryWalker {
- public FooDirectoryWalker(IOFileFilter dirFilter, IOFileFilter fileFilter) {
- super(dirFilter, fileFilter, -1);
- }
- }
- // Use the filters to construct the walker
- FooDirectoryWalker walker = new FooDirectoryWalker(
- HiddenFileFilter.VISIBLE,
- FileFilterUtils.suffixFileFilter(".txt"),
- );
- </pre>
- This is much simpler than the previous example, and is why it is the preferred
- option for filtering.
- <a name="cancel"></a>
- <h3>3. Cancellation</h3>
- The DirectoryWalker contains some of the logic required for cancel processing.
- Subclasses must complete the implementation.
- <p>
- What <code>DirectoryWalker</code> does provide for cancellation is:
- <ul>
- <li><a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a> which can be thrown in any of the
- <i>lifecycle</i> methods to stop processing.</li>
- <li>The <code>walk()</code> method traps thrown <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a>
- and calls the <code>handleCancelled()</code> method, providing
- a place for custom cancel processing.</li>
- </ul>
- <p>
- Implementations need to provide:
- <ul>
- <li>The decision logic on whether to cancel processing or not.</li>
- <li>Constructing and throwing a <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a>.</li>
- <li>Custom cancel processing in the <code>handleCancelled()</code> method.
- </ul>
- <p>
- Two possible scenarios are envisaged for cancellation:
- <ul>
- <li><a href="#external">3.1 External / Multi-threaded</a> - cancellation being
- decided/initiated by an external process.</li>
- <li><a href="#internal">3.2 Internal</a> - cancellation being decided/initiated
- from within a DirectoryWalker implementation.</li>
- </ul>
- <p>
- The following sections provide example implementations for these two different
- scenarios.
- <a name="external"></a>
- <h4>3.1 External / Multi-threaded</h4>
- This example provides a public <code>cancel()</code> method that can be
- called by another thread to stop the processing. A typical example use-case
- would be a cancel button on a GUI. Calling this method sets a
- <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#36930">
- volatile</a> flag to ensure it will work properly in a multi-threaded environment.
- The flag is returned by the <code>handleIsCancelled()</code> method, which
- will cause the walk to stop immediately. The <code>handleCancelled()</code>
- method will be the next, and last, callback method received once cancellation
- has occurred.
- <pre>
- public class FooDirectoryWalker extends DirectoryWalker {
- private volatile boolean cancelled = false;
- public void cancel() {
- cancelled = true;
- }
- protected boolean handleIsCancelled(File file, int depth, Collection results) {
- return cancelled;
- }
- protected void handleCancelled(File startDirectory, Collection results, CancelException cancel) {
- // implement processing required when a cancellation occurs
- }
- }
- </pre>
- <a name="internal"></a>
- <h4>3.2 Internal</h4>
- This shows an example of how internal cancellation processing could be implemented.
- <b>Note</b> the decision logic and throwing a <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a> could be implemented
- in any of the <i>lifecycle</i> methods.
- <pre>
- public class BarDirectoryWalker extends DirectoryWalker {
- protected boolean handleDirectory(File directory, int depth, Collection results) throws IOException {
- // cancel if hidden directory
- if (directory.isHidden()) {
- throw new CancelException(file, depth);
- }
- return true;
- }
- protected void handleFile(File file, int depth, Collection results) throws IOException {
- // cancel if read-only file
- if (!file.canWrite()) {
- throw new CancelException(file, depth);
- }
- results.add(file);
- }
- protected void handleCancelled(File startDirectory, Collection results, CancelException cancel) {
- // implement processing required when a cancellation occurs
- }
- }
- </pre></div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- <dt><span class="simpleTagLabel">Version:</span></dt>
- <dd>$Id$</dd>
- </dl>
- </li>
- </ul>
- </div>
- <div class="summary">
- <ul class="blockList">
- <li class="blockList">
- <!-- ======== NESTED CLASS SUMMARY ======== -->
- <ul class="blockList">
- <li class="blockList"><a name="nested.class.summary">
- <!-- -->
- </a>
- <h3>Nested Class Summary</h3>
- <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
- <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier and Type</th>
- <th class="colLast" scope="col">Class and Description</th>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static class </code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io">DirectoryWalker.CancelException</a></span></code>
- <div class="block">CancelException is thrown in DirectoryWalker to cancel the current
- processing.</div>
- </td>
- </tr>
- </table>
- </li>
- </ul>
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
- <ul class="blockList">
- <li class="blockList"><a name="constructor.summary">
- <!-- -->
- </a>
- <h3>Constructor Summary</h3>
- <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
- <caption><span>Constructors</span><span class="tabEnd"> </span></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier</th>
- <th class="colLast" scope="col">Constructor and Description</th>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>protected </code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#DirectoryWalker--">DirectoryWalker</a></span>()</code>
- <div class="block">Construct an instance with no filtering and unlimited <i>depth</i>.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>protected </code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#DirectoryWalker-java.io.FileFilter-int-">DirectoryWalker</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a> filter,
- int depthLimit)</code>
- <div class="block">Construct an instance with a filter and limit the <i>depth</i> navigated to.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>protected </code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#DirectoryWalker-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-int-">DirectoryWalker</a></span>(<a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> directoryFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- int depthLimit)</code>
- <div class="block">Construct an instance with a directory and a file filter and an optional
- limit on the <i>depth</i> navigated to.</div>
- </td>
- </tr>
- </table>
- </li>
- </ul>
- <!-- ========== METHOD SUMMARY =========== -->
- <ul class="blockList">
- <li class="blockList"><a name="method.summary">
- <!-- -->
- </a>
- <h3>Method Summary</h3>
- <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
- <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier and Type</th>
- <th class="colLast" scope="col">Method and Description</th>
- </tr>
- <tr id="i0" class="altColor">
- <td class="colFirst"><code>protected void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#checkIfCancelled-java.io.File-int-java.util.Collection-">checkIfCancelled</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Checks whether the walk has been cancelled by calling <a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleIsCancelled-java.io.File-int-java.util.Collection-"><code>handleIsCancelled(java.io.File, int, java.util.Collection<T>)</code></a>,
- throwing a <code>CancelException</code> if it has.</div>
- </td>
- </tr>
- <tr id="i1" class="rowColor">
- <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[]</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#filterDirectoryContents-java.io.File-int-java.io.File:A-">filterDirectoryContents</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[] files)</code>
- <div class="block">Overridable callback method invoked with the contents of each directory.</div>
- </td>
- </tr>
- <tr id="i2" class="altColor">
- <td class="colFirst"><code>protected void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleCancelled-java.io.File-java.util.Collection-org.apache.commons.io.DirectoryWalker.CancelException-">handleCancelled</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> startDirectory,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results,
- <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io">DirectoryWalker.CancelException</a> cancel)</code>
- <div class="block">Overridable callback method invoked when the operation is cancelled.</div>
- </td>
- </tr>
- <tr id="i3" class="rowColor">
- <td class="colFirst"><code>protected boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleDirectory-java.io.File-int-java.util.Collection-">handleDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Overridable callback method invoked to determine if a directory should be processed.</div>
- </td>
- </tr>
- <tr id="i4" class="altColor">
- <td class="colFirst"><code>protected void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleDirectoryEnd-java.io.File-int-java.util.Collection-">handleDirectoryEnd</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Overridable callback method invoked at the end of processing each directory.</div>
- </td>
- </tr>
- <tr id="i5" class="rowColor">
- <td class="colFirst"><code>protected void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleDirectoryStart-java.io.File-int-java.util.Collection-">handleDirectoryStart</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Overridable callback method invoked at the start of processing each directory.</div>
- </td>
- </tr>
- <tr id="i6" class="altColor">
- <td class="colFirst"><code>protected void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleEnd-java.util.Collection-">handleEnd</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Overridable callback method invoked at the end of processing.</div>
- </td>
- </tr>
- <tr id="i7" class="rowColor">
- <td class="colFirst"><code>protected void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleFile-java.io.File-int-java.util.Collection-">handleFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Overridable callback method invoked for each (non-directory) file.</div>
- </td>
- </tr>
- <tr id="i8" class="altColor">
- <td class="colFirst"><code>protected boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleIsCancelled-java.io.File-int-java.util.Collection-">handleIsCancelled</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Overridable callback method invoked to determine if the entire walk
- operation should be immediately cancelled.</div>
- </td>
- </tr>
- <tr id="i9" class="rowColor">
- <td class="colFirst"><code>protected void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleRestricted-java.io.File-int-java.util.Collection-">handleRestricted</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Overridable callback method invoked for each restricted directory.</div>
- </td>
- </tr>
- <tr id="i10" class="altColor">
- <td class="colFirst"><code>protected void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleStart-java.io.File-java.util.Collection-">handleStart</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> startDirectory,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Overridable callback method invoked at the start of processing.</div>
- </td>
- </tr>
- <tr id="i11" class="rowColor">
- <td class="colFirst"><code>protected void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/DirectoryWalker.html#walk-java.io.File-java.util.Collection-">walk</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> startDirectory,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)</code>
- <div class="block">Internal method that walks the directory hierarchy in a depth-first manner.</div>
- </td>
- </tr>
- </table>
- <ul class="blockList">
- <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
- <!-- -->
- </a>
- <h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
- <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </div>
- <div class="details">
- <ul class="blockList">
- <li class="blockList">
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <ul class="blockList">
- <li class="blockList"><a name="constructor.detail">
- <!-- -->
- </a>
- <h3>Constructor Detail</h3>
- <a name="DirectoryWalker--">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>DirectoryWalker</h4>
- <pre>protected DirectoryWalker()</pre>
- <div class="block">Construct an instance with no filtering and unlimited <i>depth</i>.</div>
- </li>
- </ul>
- <a name="DirectoryWalker-java.io.FileFilter-int-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>DirectoryWalker</h4>
- <pre>protected DirectoryWalker(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a> filter,
- int depthLimit)</pre>
- <div class="block">Construct an instance with a filter and limit the <i>depth</i> navigated to.
- <p>
- The filter controls which files and directories will be navigated to as
- part of the walk. The <a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html" title="class in org.apache.commons.io.filefilter"><code>FileFilterUtils</code></a> class is useful for combining
- various filters together. A <code>null</code> filter means that no
- filtering should occur and all files and directories will be visited.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>filter</code> - the filter to apply, null means visit all files</dd>
- <dd><code>depthLimit</code> - controls how <i>deep</i> the hierarchy is
- navigated to (less than 0 means unlimited)</dd>
- </dl>
- </li>
- </ul>
- <a name="DirectoryWalker-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-int-">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>DirectoryWalker</h4>
- <pre>protected DirectoryWalker(<a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> directoryFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- int depthLimit)</pre>
- <div class="block">Construct an instance with a directory and a file filter and an optional
- limit on the <i>depth</i> navigated to.
- <p>
- The filters control which files and directories will be navigated to as part
- of the walk. This constructor uses <a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html#makeDirectoryOnly-org.apache.commons.io.filefilter.IOFileFilter-"><code>FileFilterUtils.makeDirectoryOnly(IOFileFilter)</code></a>
- and <a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html#makeFileOnly-org.apache.commons.io.filefilter.IOFileFilter-"><code>FileFilterUtils.makeFileOnly(IOFileFilter)</code></a> internally to combine the filters.
- A <code>null</code> filter means that no filtering should occur.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directoryFilter</code> - the filter to apply to directories, null means visit all directories</dd>
- <dd><code>fileFilter</code> - the filter to apply to files, null means visit all files</dd>
- <dd><code>depthLimit</code> - controls how <i>deep</i> the hierarchy is
- navigated to (less than 0 means unlimited)</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- <!-- ============ METHOD DETAIL ========== -->
- <ul class="blockList">
- <li class="blockList"><a name="method.detail">
- <!-- -->
- </a>
- <h3>Method Detail</h3>
- <a name="walk-java.io.File-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>walk</h4>
- <pre>protected final void walk(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> startDirectory,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Internal method that walks the directory hierarchy in a depth-first manner.
- <p>
- Users of this class do not need to call this method. This method will
- be called automatically by another (public) method on the specific subclass.
- <p>
- Writers of subclasses should call this method to start the directory walk.
- Once called, this method will emit events as it walks the hierarchy.
- The event methods have the prefix <code>handle</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>startDirectory</code> - the directory to start from, not null</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the start directory is null</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="checkIfCancelled-java.io.File-int-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>checkIfCancelled</h4>
- <pre>protected final void checkIfCancelled(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Checks whether the walk has been cancelled by calling <a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleIsCancelled-java.io.File-int-java.util.Collection-"><code>handleIsCancelled(java.io.File, int, java.util.Collection<T>)</code></a>,
- throwing a <code>CancelException</code> if it has.
- <p>
- Writers of subclasses should not normally call this method as it is called
- automatically by the walk of the tree. However, sometimes a single method,
- typically <a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleFile-java.io.File-int-java.util.Collection-"><code>handleFile(java.io.File, int, java.util.Collection<T>)</code></a>, may take a long time to run. In that case,
- you may wish to check for cancellation by calling this method.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the current file being processed</dd>
- <dd><code>depth</code> - the current file level (starting directory = 0)</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="handleIsCancelled-java.io.File-int-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>handleIsCancelled</h4>
- <pre>protected boolean handleIsCancelled(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked to determine if the entire walk
- operation should be immediately cancelled.
- <p>
- This method should be implemented by those subclasses that want to
- provide a public <code>cancel()</code> method available from another
- thread. The design pattern for the subclass should be as follows:
- <pre>
- public class FooDirectoryWalker extends DirectoryWalker {
- private volatile boolean cancelled = false;
- public void cancel() {
- cancelled = true;
- }
- private void handleIsCancelled(File file, int depth, Collection results) {
- return cancelled;
- }
- protected void handleCancelled(File startDirectory,
- Collection results, CancelException cancel) {
- // implement processing required when a cancellation occurs
- }
- }
- </pre>
- <p>
- If this method returns true, then the directory walk is immediately
- cancelled. The next callback method will be <a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleCancelled-java.io.File-java.util.Collection-org.apache.commons.io.DirectoryWalker.CancelException-"><code>handleCancelled(java.io.File, java.util.Collection<T>, org.apache.commons.io.DirectoryWalker.CancelException)</code></a>.
- <p>
- This implementation returns false.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file or directory being processed</dd>
- <dd><code>depth</code> - the current directory level (starting directory = 0)</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the walk has been cancelled</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="handleCancelled-java.io.File-java.util.Collection-org.apache.commons.io.DirectoryWalker.CancelException-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>handleCancelled</h4>
- <pre>protected void handleCancelled(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> startDirectory,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results,
- <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io">DirectoryWalker.CancelException</a> cancel)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked when the operation is cancelled.
- The file being processed when the cancellation occurred can be
- obtained from the exception.
- <p>
- This implementation just re-throws the <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>startDirectory</code> - the directory that the walk started from</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dd><code>cancel</code> - the exception throw to cancel further processing
- containing details at the point of cancellation.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="handleStart-java.io.File-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>handleStart</h4>
- <pre>protected void handleStart(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> startDirectory,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked at the start of processing.
- <p>
- This implementation does nothing.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>startDirectory</code> - the directory to start from</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="handleDirectory-java.io.File-int-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>handleDirectory</h4>
- <pre>protected boolean handleDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked to determine if a directory should be processed.
- <p>
- This method returns a boolean to indicate if the directory should be examined or not.
- If you return false, the entire directory and any subdirectories will be skipped.
- Note that this functionality is in addition to the filtering by file filter.
- <p>
- This implementation does nothing and returns true.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the current directory being processed</dd>
- <dd><code>depth</code> - the current directory level (starting directory = 0)</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true to process this directory, false to skip this directory</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="handleDirectoryStart-java.io.File-int-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>handleDirectoryStart</h4>
- <pre>protected void handleDirectoryStart(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked at the start of processing each directory.
- <p>
- This implementation does nothing.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the current directory being processed</dd>
- <dd><code>depth</code> - the current directory level (starting directory = 0)</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="filterDirectoryContents-java.io.File-int-java.io.File:A-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>filterDirectoryContents</h4>
- <pre>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[] filterDirectoryContents(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[] files)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked with the contents of each directory.
- <p>
- This implementation returns the files unchanged</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the current directory being processed</dd>
- <dd><code>depth</code> - the current directory level (starting directory = 0)</dd>
- <dd><code>files</code> - the files (possibly filtered) in the directory, may be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the filtered list of files</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="handleFile-java.io.File-int-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>handleFile</h4>
- <pre>protected void handleFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked for each (non-directory) file.
- <p>
- This implementation does nothing.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the current file being processed</dd>
- <dd><code>depth</code> - the current directory level (starting directory = 0)</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="handleRestricted-java.io.File-int-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>handleRestricted</h4>
- <pre>protected void handleRestricted(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked for each restricted directory.
- <p>
- This implementation does nothing.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the restricted directory</dd>
- <dd><code>depth</code> - the current directory level (starting directory = 0)</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="handleDirectoryEnd-java.io.File-int-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>handleDirectoryEnd</h4>
- <pre>protected void handleDirectoryEnd(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- int depth,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked at the end of processing each directory.
- <p>
- This implementation does nothing.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the directory being processed</dd>
- <dd><code>depth</code> - the current directory level (starting directory = 0)</dd>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="handleEnd-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>handleEnd</h4>
- <pre>protected void handleEnd(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a><<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>> results)
- throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
- <div class="block">Overridable callback method invoked at the end of processing.
- <p>
- This implementation does nothing.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>results</code> - the collection of result objects, may be updated</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </div>
- </div>
- <!-- ========= END OF CLASS DATA ========= -->
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <div class="bottomNav"><a name="navbar.bottom">
- <!-- -->
- </a>
- <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
- <a name="navbar.bottom.firstrow">
- <!-- -->
- </a>
- <ul class="navList" title="Navigation">
- <li><a href="../../../../overview-summary.html">Overview</a></li>
- <li><a href="package-summary.html">Package</a></li>
- <li class="navBarCell1Rev">Class</li>
- <li><a href="class-use/DirectoryWalker.html">Use</a></li>
- <li><a href="package-tree.html">Tree</a></li>
- <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
- <li><a href="../../../../index-all.html">Index</a></li>
- <li><a href="../../../../help-doc.html">Help</a></li>
- </ul>
- </div>
- <div class="subNav">
- <ul class="navList">
- <li><a href="../../../../org/apache/commons/io/CopyUtils.html" title="class in org.apache.commons.io"><span class="typeNameLink">Prev Class</span></a></li>
- <li><a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><span class="typeNameLink">Next Class</span></a></li>
- </ul>
- <ul class="navList">
- <li><a href="../../../../index.html?org/apache/commons/io/DirectoryWalker.html" target="_top">Frames</a></li>
- <li><a href="DirectoryWalker.html" target="_top">No Frames</a></li>
- </ul>
- <ul class="navList" id="allclasses_navbar_bottom">
- <li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
- </ul>
- <div>
- <script type="text/javascript"><!--
- allClassesLink = document.getElementById("allclasses_navbar_bottom");
- if(window==top) {
- allClassesLink.style.display = "block";
- }
- else {
- allClassesLink.style.display = "none";
- }
- //-->
- </script>
- </div>
- <div>
- <ul class="subNavList">
- <li>Summary: </li>
- <li><a href="#nested.class.summary">Nested</a> | </li>
- <li>Field | </li>
- <li><a href="#constructor.summary">Constr</a> | </li>
- <li><a href="#method.summary">Method</a></li>
- </ul>
- <ul class="subNavList">
- <li>Detail: </li>
- <li>Field | </li>
- <li><a href="#constructor.detail">Constr</a> | </li>
- <li><a href="#method.detail">Method</a></li>
- </ul>
- </div>
- <a name="skip.navbar.bottom">
- <!-- -->
- </a></div>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
- <p class="legalCopy"><small>Copyright © 2002–2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
- </body>
- </html>
|