@MinDoc(copyright="Copyright 2001 - 2002, 2009 A. Weinert", author="Albrecht Weinert", version="V.65", lastModified="3.06.2024", usage="use implementing classes to act on directories and files", purpose="a visitor for files and directories") public interface FileVisitor
visit(File).
This method is the concrete action and may be whatever the application
has to to — delete, list, ask an controller / observer what to do
or else.FileVisitor.Ask, FileVisitor.AskConsImpl,
FileVisitor.AskGrafImpl) and in the class FileService.
Via FileService it is used in most Frame4J's file handling
tools.| Modifier and Type | Interface and Description |
|---|---|
static class |
FileVisitor.Ask
An implementation of FileVisitor: Ask a question on a file.
|
static class |
FileVisitor.AskConsImpl
An implementation of FileVisitor (question at console).
|
static class |
FileVisitor.AskGrafImpl
An implementation of FileVisitor (question at a window).
|
| Modifier and Type | Method and Description |
|---|---|
int |
visit(File dD)
The "deed" or action with the file visited.
|
int visit(File dD)
FileService's working methods
dirVisit(.. FileVisitors ..) for example totally ignores those returned
values. Nevertheless each implementation must document its
return values. See
makeInCollectionVisitor(),
makeOutputInfoVisitor()
and
makeOutputListVisitor(),
as examples.file visited the returned value
is what matters. See FileVisitor.AskConsImpl and
AskGrafImpl as examples. The return value has to be specified
fitting the intended application.AskConsImpl and AskGrafImpl
— is:| Return value | Key | Button | Meaning |
|---|---|---|---|
| 1 | j J y Y | Left | Acknowledge (Answer Ja Yes) |
| 2 | o O | - | Acknowledge explicitly for overwriting |
| 3 | a A | Middle | Acknowledge explicitly for appending |
| 0 | others | Right | Negative, No, Nein |
| -2 | q Q | X Menu |
Request to end (Quit) |
| -1 | No answer / reaction within waiting time
( maxWait/10 s). | ||
dD - the file or directory to act upon or to determine a filter /
function response aboutdoUpDate()