@MinDoc(copyright="Copyright 2001, 2004, 2009 A. Weinert", author="Albrecht Weinert", version="see enclosing interface FileVisitor", lastModified="see enclosing interface FileVisitor", lastModifiedBy="see enclosing interface FileVisitor", usage="a visitor for files", purpose="ask a question on the visited file (on console)") public static class FileVisitor.AskConsImpl extends FileVisitor.Ask
FileVisitor
the method
visit(File)
of which asks a question on the file
visited by outputting a report / question on the console and
a prompt line. Then the answer is read from that console / shell.FileVisitor.Ask.askPatt
will be
output on System.err (wrapped as PrintStream) or on an extra provided
PrintStream
daOut
.FileVisitor.AskGrafImpl
instead.PrintStream
daOut
. The TeeWriter
may optionally branch to a file giving the logging or most of it
for free.FileVisitor.Ask, FileVisitor.AskConsImpl, FileVisitor.AskGrafImpl
Modifier and Type | Field and Description |
---|---|
protected PrintWriter |
daOut
The PrintStream to display the file denomination and the question.
|
protected PrintWriter |
daPrm
The PrintStream to display the user prompt.
|
ansPrompt, append, askPatt, deleteMode, lower, maxWait, no, yes
Constructor and Description |
---|
AskConsImpl(boolean deleteMode,
PropMap prop,
PrintWriter daOut)
Make an AskConsImpl object.
|
AskConsImpl(boolean deleteMode,
String fragPatt,
String ansPrompt,
PrintWriter daOut)
Make an AskConsImpl object.
|
Modifier and Type | Method and Description |
---|---|
int |
visit(File dD)
The "deed" or action with the file visited.
|
dispose, set, set
protected final PrintWriter daOut
protected final PrintWriter daPrm
System
.err
by the
constructor trying to use ComVar.CONSOL_ENCODING
.public AskConsImpl(boolean deleteMode, String fragPatt, String ansPrompt, PrintWriter daOut)
FileVisitor.Ask.deleteMode
will be set finally by the parameter provided.
It will be tried, to use an AppLangMap
object to the the textual
properties, see Ask
.fragPatt
resp. ansPrompt
are given they will
set FileVisitor.Ask.askPatt
resp. FileVisitor.Ask.ansPrompt
.
AppLangMap.getUMap()
,
daOut
public AskConsImpl(boolean deleteMode, PropMap prop, PrintWriter daOut)
FileVisitor.Ask.deleteMode
will be set finally by the parameter provided.
It will be tried to set this objects properties by prop
.FileVisitor.Ask
,
daOut
public int visit(File dD)
dD
is null 0 (as negative acknowledge) is returned
immediately.dD
does not exist 1 (as acknowledge) is returned
without further actions.FileVisitor.visit()
for the return values recommended and implemented here.dD
- the file or directory to act upon or to determine a filter /
function response aboutFileVisitor.visit(File)
,
FileVisitor.visit(File)