/** * 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>. * * @param startDirectory the directory to start from, not null * @param results the collection of result objects, may be updated * @throws NullPointerException if the start directory is null * @throws IOException if an I/O Error occurs */ protected final void walk(final File startDirectory, final Collection<T> results) throws IOException { if (startDirectory == null) { throw new NullPointerException("Start Directory is null"); } try { handleStart(startDirectory, results); walk(startDirectory, 0, results); handleEnd(results); } catch(final CancelException cancel) { handleCancelled(startDirectory, results, cancel); } }
/** * 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>. * * @param startDirectory the directory to start from, not null * @param results the collection of result objects, may be updated * @throws NullPointerException if the start directory is null * @throws IOException if an I/O Error occurs */ protected final void walk(File startDirectory, Collection results) throws IOException { if (startDirectory == null) { throw new NullPointerException("Start Directory is null"); } try { handleStart(startDirectory, results); walk(startDirectory, 0, results); handleEnd(results); } catch(CancelException cancel) { handleCancelled(startDirectory, results, cancel); } }
/** * @see org.apache.commons.io.DirectoryWalker#handleStart(java.io.File, java.util.Collection) */ @Override protected void handleStart(File startDirectory, Collection results) throws IOException { LOG.debug("starting process"); super.handleStart(startDirectory, results); } }
@Override protected void handleStart(final File file, final Collection<File> items) throws IOException { this.path = file.getAbsolutePath(); this.length = this.path.length() + 1; super.handleStart(file, items); } }
/** * 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>. * * @param startDirectory the directory to start from, not null * @param results the collection of result objects, may be updated * @throws NullPointerException if the start directory is null * @throws IOException if an I/O Error occurs */ protected final void walk(File startDirectory, Collection results) throws IOException { if (startDirectory == null) { throw new NullPointerException("Start Directory is null"); } try { handleStart(startDirectory, results); walk(startDirectory, 0, results); handleEnd(results); } catch(CancelException cancel) { handleCancelled(startDirectory, results, cancel); } }
/** * 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>. * * @param startDirectory the directory to start from, not null * @param results the collection of result objects, may be updated * @throws NullPointerException if the start directory is null * @throws IOException if an I/O Error occurs */ protected final void walk(File startDirectory, Collection<T> results) throws IOException { if (startDirectory == null) { throw new NullPointerException("Start Directory is null"); } try { handleStart(startDirectory, results); walk(startDirectory, 0, results); handleEnd(results); } catch(CancelException cancel) { handleCancelled(startDirectory, results, cancel); } }
/** * 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>. * * @param startDirectory the directory to start from, not null * @param results the collection of result objects, may be updated * @throws NullPointerException if the start directory is null * @throws IOException if an I/O Error occurs */ protected final void walk(final File startDirectory, final Collection<T> results) throws IOException { if (startDirectory == null) { throw new NullPointerException("Start Directory is null"); } try { handleStart(startDirectory, results); walk(startDirectory, 0, results); handleEnd(results); } catch(final CancelException cancel) { handleCancelled(startDirectory, results, cancel); } }
/** * 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>. * * @param startDirectory the directory to start from, not null * @param results the collection of result objects, may be updated * @throws NullPointerException if the start directory is null * @throws IOException if an I/O Error occurs */ protected final void walk(File startDirectory, Collection results) throws IOException { if (startDirectory == null) { throw new NullPointerException("Start Directory is null"); } try { handleStart(startDirectory, results); walk(startDirectory, 0, results); handleEnd(results); } catch(CancelException cancel) { handleCancelled(startDirectory, results, cancel); } }
/** * 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>. * * @param startDirectory the directory to start from, not null * @param results the collection of result objects, may be updated * @throws NullPointerException if the start directory is null * @throws IOException if an I/O Error occurs */ protected final void walk(File startDirectory, Collection<T> results) throws IOException { if (startDirectory == null) { throw new NullPointerException("Start Directory is null"); } try { handleStart(startDirectory, results); walk(startDirectory, 0, results); handleEnd(results); } catch(CancelException cancel) { handleCancelled(startDirectory, results, cancel); } }
/** * 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>. * * @param startDirectory the directory to start from, not null * @param results the collection of result objects, may be updated * @throws NullPointerException if the start directory is null * @throws IOException if an I/O Error occurs */ protected final void walk(final File startDirectory, final Collection<T> results) throws IOException { if (startDirectory == null) { throw new NullPointerException("Start Directory is null"); } try { handleStart(startDirectory, results); walk(startDirectory, 0, results); handleEnd(results); } catch(final CancelException cancel) { handleCancelled(startDirectory, results, cancel); } }