248248 * @since Commons IO 1.3
249249 * @version $Revision$
250250 */
251- public abstract class DirectoryWalker {
251+ public abstract class DirectoryWalker < T > {
252252
253253 /**
254254 * The file filter to use to filter files and directories.
@@ -326,7 +326,7 @@ protected DirectoryWalker(IOFileFilter directoryFilter, IOFileFilter fileFilter,
326326 * @throws NullPointerException if the start directory is null
327327 * @throws IOException if an I/O Error occurs
328328 */
329- protected final void walk (File startDirectory , Collection <? > results ) throws IOException {
329+ protected final void walk (File startDirectory , Collection <T > results ) throws IOException {
330330 if (startDirectory == null ) {
331331 throw new NullPointerException ("Start Directory is null" );
332332 }
@@ -347,7 +347,7 @@ protected final void walk(File startDirectory, Collection<?> results) throws IOE
347347 * @param results the collection of result objects, may be updated
348348 * @throws IOException if an I/O Error occurs
349349 */
350- private void walk (File directory , int depth , Collection <? > results ) throws IOException {
350+ private void walk (File directory , int depth , Collection <T > results ) throws IOException {
351351 checkIfCancelled (directory , depth , results );
352352 if (handleDirectory (directory , depth , results )) {
353353 handleDirectoryStart (directory , depth , results );
@@ -390,7 +390,7 @@ private void walk(File directory, int depth, Collection<?> results) throws IOExc
390390 * @param results the collection of result objects, may be updated
391391 * @throws IOException if an I/O Error occurs
392392 */
393- protected final void checkIfCancelled (File file , int depth , Collection <? > results ) throws IOException {
393+ protected final void checkIfCancelled (File file , int depth , Collection <T > results ) throws IOException {
394394 if (handleIsCancelled (file , depth , results )) {
395395 throw new CancelException (file , depth );
396396 }
@@ -432,7 +432,7 @@ protected final void checkIfCancelled(File file, int depth, Collection<?> result
432432 * @throws IOException if an I/O Error occurs
433433 */
434434 protected boolean handleIsCancelled (
435- File file , int depth , Collection <? > results ) throws IOException {
435+ File file , int depth , Collection <T > results ) throws IOException {
436436 // do nothing - overridable by subclass
437437 return false ; // not cancelled
438438 }
@@ -450,7 +450,7 @@ protected boolean handleIsCancelled(
450450 * containing details at the point of cancellation.
451451 * @throws IOException if an I/O Error occurs
452452 */
453- protected void handleCancelled (File startDirectory , Collection <? > results ,
453+ protected void handleCancelled (File startDirectory , Collection <T > results ,
454454 CancelException cancel ) throws IOException {
455455 // re-throw exception - overridable by subclass
456456 throw cancel ;
@@ -466,7 +466,7 @@ protected void handleCancelled(File startDirectory, Collection<?> results,
466466 * @param results the collection of result objects, may be updated
467467 * @throws IOException if an I/O Error occurs
468468 */
469- protected void handleStart (File startDirectory , Collection <? > results ) throws IOException {
469+ protected void handleStart (File startDirectory , Collection <T > results ) throws IOException {
470470 // do nothing - overridable by subclass
471471 }
472472
@@ -485,7 +485,7 @@ protected void handleStart(File startDirectory, Collection<?> results) throws IO
485485 * @return true to process this directory, false to skip this directory
486486 * @throws IOException if an I/O Error occurs
487487 */
488- protected boolean handleDirectory (File directory , int depth , Collection <? > results ) throws IOException {
488+ protected boolean handleDirectory (File directory , int depth , Collection <T > results ) throws IOException {
489489 // do nothing - overridable by subclass
490490 return true ; // process directory
491491 }
@@ -500,7 +500,7 @@ protected boolean handleDirectory(File directory, int depth, Collection<?> resul
500500 * @param results the collection of result objects, may be updated
501501 * @throws IOException if an I/O Error occurs
502502 */
503- protected void handleDirectoryStart (File directory , int depth , Collection <? > results ) throws IOException {
503+ protected void handleDirectoryStart (File directory , int depth , Collection <T > results ) throws IOException {
504504 // do nothing - overridable by subclass
505505 }
506506
@@ -529,7 +529,7 @@ protected File[] filterDirectoryContents(File directory, int depth, File[] files
529529 * @param results the collection of result objects, may be updated
530530 * @throws IOException if an I/O Error occurs
531531 */
532- protected void handleFile (File file , int depth , Collection <? > results ) throws IOException {
532+ protected void handleFile (File file , int depth , Collection <T > results ) throws IOException {
533533 // do nothing - overridable by subclass
534534 }
535535
@@ -543,7 +543,7 @@ protected void handleFile(File file, int depth, Collection<?> results) throws IO
543543 * @param results the collection of result objects, may be updated
544544 * @throws IOException if an I/O Error occurs
545545 */
546- protected void handleRestricted (File directory , int depth , Collection <? > results ) throws IOException {
546+ protected void handleRestricted (File directory , int depth , Collection <T > results ) throws IOException {
547547 // do nothing - overridable by subclass
548548 }
549549
@@ -557,7 +557,7 @@ protected void handleRestricted(File directory, int depth, Collection<?> results
557557 * @param results the collection of result objects, may be updated
558558 * @throws IOException if an I/O Error occurs
559559 */
560- protected void handleDirectoryEnd (File directory , int depth , Collection <? > results ) throws IOException {
560+ protected void handleDirectoryEnd (File directory , int depth , Collection <T > results ) throws IOException {
561561 // do nothing - overridable by subclass
562562 }
563563
@@ -569,7 +569,7 @@ protected void handleDirectoryEnd(File directory, int depth, Collection<?> resul
569569 * @param results the collection of result objects, may be updated
570570 * @throws IOException if an I/O Error occurs
571571 */
572- protected void handleEnd (Collection <? > results ) throws IOException {
572+ protected void handleEnd (Collection <T > results ) throws IOException {
573573 // do nothing - overridable by subclass
574574 }
575575
0 commit comments