Created
August 29, 2012 09:06
-
-
Save struberg/3508860 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.apache.maven.shared.utils.io; | |
import java.io.File; | |
/** | |
* <p>Visitor pattern for the DirectoryScanner. A ScanConductor controls the scanning process.</p> | |
* | |
* <p>Create an instance and pass it to {@link org.apache.maven.shared.utils.io.DirectoryScanner#scan(ScanConductor)}. | |
* You will get notified about every visited directory and file. You can use the {@link ScanAction} | |
* to control what should happen next.</p> | |
* | |
* @author <a href="mailto:[email protected]">Mark Struberg</a> | |
*/ | |
public interface ScanConductor | |
{ | |
public enum ScanAction | |
{ | |
/** | |
* Abort the whole scanning. | |
*/ | |
ABORT, | |
/** | |
* Continue with the scanning | |
*/ | |
CONTINUE, | |
/** | |
* This response is only valid for {@link ScanConductor#visitDirectory(java.io.File)}. | |
* Do not recurse into the current directory. | |
*/ | |
NO_RECURSE, | |
/** | |
* Abort the scanning of the current directory | |
*/ | |
ABORT_DIRECTORY | |
} | |
/** | |
* This method will get invoked for every detected directory. | |
* | |
* @param directory | |
* @return the ScanAction to control how to proceed with the scanning | |
*/ | |
ScanAction visitDirectory(File directory); | |
/** | |
* This method will get invoked for every detected file. | |
* | |
* @param file | |
* @return the ScanAction to control how to proceed with the scanning | |
*/ | |
ScanAction visitFile(File file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment