|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.org.retep.util.io.AbstractFileVisitor
public abstract class AbstractFileVisitor
An abstract implementation of FileVisitor which can log a message every time a visit on a File returns true. For example, the FileVisitor returned by FileUtils.getSetExecutableVisitor() will log "Set executable on filename" whenever a file has been set executable. Note: If the supplied Log instance is null, then no logging is performed.
| Constructor Summary | |
|---|---|
AbstractFileVisitor()
Create a visitor with no logging |
|
AbstractFileVisitor(Log log)
Equivalent to new AbstractFileVisitor( log, "Modified %s" ); |
|
AbstractFileVisitor(Log log,
java.lang.String message)
Construct a visitor with a Log and a message to log whenever an action is performed and returns true. |
|
| Method Summary | |
|---|---|
protected void |
error(java.lang.String msg,
java.lang.Object... args)
|
protected abstract boolean |
execute(java.io.File file)
Subclasses implement this method to perform an action on a File. |
protected void |
fatal(java.lang.String msg,
java.lang.Object... args)
|
protected void |
info(java.lang.String msg,
java.lang.Object... args)
|
boolean |
visit(java.io.File file)
Call execute() on a file. |
protected void |
warn(java.lang.String msg,
java.lang.Object... args)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractFileVisitor()
public AbstractFileVisitor(Log log)
log - Log to use, ignored if null
public AbstractFileVisitor(Log log,
java.lang.String message)
log - Log to use, ignored if nullmessage - The message to log when an action is performed and log is
not null. One instance of %s is permitted, which is replaced by
File.getPath()| Method Detail |
|---|
protected final void info(java.lang.String msg,
java.lang.Object... args)
protected final void warn(java.lang.String msg,
java.lang.Object... args)
protected final void error(java.lang.String msg,
java.lang.Object... args)
protected final void fatal(java.lang.String msg,
java.lang.Object... args)
public final boolean visit(java.io.File file)
throws java.io.IOException
visit in interface FileVisitorfile - File to visit
java.io.IOException - when an error occurs
protected abstract boolean execute(java.io.File file)
throws java.io.IOException
file - File to visit
java.io.IOException - when an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||