public interface MainCmd_ifc extends Report
date who change 2007-12-29 JcHartmut displace some methods to org.vishia.mainCmd.Report. 2007-03-07 JcHartmut Method getReportFileName 2006-01-07 JcHartmut some corrections 2004-06-00 JcHartmut initial revision
anytime, eventOrder, exitSuccessfull, exitUserAbort, exitWithArgumentError, exitWithErrors, exitWithFileProblems, exitWithNotes, exitWithWarnings, fineEventOrder, interested, version
dateFormat, debug, error, fineDebug, fineInfo, info, minSecondsFormat, mNeverOutputToDisplay, mReportLevel, sVersion, warning
Modifier and Type | Method and Description |
---|---|
java.lang.String |
currdir()
Returns a local valid current directory.
|
int |
executeCmdLine(java.lang.ProcessBuilder processBuilder,
java.lang.String[] cmd,
java.lang.String input,
int nReportLevel,
java.lang.Appendable output,
java.lang.Appendable error)
Executes a command line call maybe as pipe, waiting for finishing..
|
int |
executeCmdLine(java.lang.ProcessBuilder processBuilder,
java.lang.String cmd,
java.lang.String input,
int nReportLevel,
java.lang.Appendable output,
java.lang.Appendable error)
Executes a command line call maybe as pipe, waiting for finishing..
|
int |
executeCmdLine(java.lang.String[] cmd,
int nReportLevel,
java.lang.Appendable output,
java.lang.String input)
Execute a command, invoke a cmdline call.
|
int |
executeCmdLine(java.lang.String cmdLine,
int nReportLevel,
java.lang.Appendable output,
java.lang.String input)
Execute a command, invoke a cmdline call.
|
java.lang.String |
getReportFileName()
Returns the name of the report file to write out as info.
|
java.lang.String |
setcurrdir(java.lang.String newdir)
Sets the Property
currdir() for this instance. |
int |
startCmdLine(java.lang.ProcessBuilder processBuilder,
java.lang.String cmd)
Starts a command invocation for a independent window.
|
int |
startCmdLine(java.lang.ProcessBuilder processBuilder,
java.lang.String[] cmd)
Starts a command invocation for a independent window.
|
int |
switchToWindowOrStartCmdline(java.lang.ProcessBuilder processBuilder,
java.lang.String sCmd,
java.lang.String sWindowTitle)
Searches the window for the already running process
or starts the process with command invocation for a independent window.
|
getLogMessageErrorConsole, getLogMessageOutputConsole, getLogMessageOutputFile
getExitErrorLevel, openReportfile, setExitErrorLevel, setOutputChannels, writeStackTrace
close, flush, flushReport, getReportLevel, getReportLevelFromIdent, isOnline, msgSec, report, report, reportln, reportln, sendMsg, sendMsgTime, sendMsgVaList, setReportLevel, setReportLevelToIdent, timeCurr, timeMsg, writeError, writeError, writeInfo, writeInfoln, writeWarning
java.lang.String getReportFileName()
int executeCmdLine(java.lang.String[] cmd, int nReportLevel, java.lang.Appendable output, java.lang.String input)
cmd
- String with the separeted parts of the command. cmd[0] is the command to invoke.nReportLevel
- Determines the kind of writing the output. Possible values are 1..6 using Report.error to Report.fineInfo
and -1..-3 using -Report.error to -report.info (with a negativ sign!). On negativ values the
report is written to display with the write..()-methods of this interface, with the
positive value, the report is written to Report.report..()-Methods.output
- If not null, than the stdout is written in this Buffer. If null, the stdout is written to report.input
- If not null, this input is send to the cmdline process. If null, no input is send.int executeCmdLine(java.lang.String cmdLine, int nReportLevel, java.lang.Appendable output, java.lang.String input)
cmdLine
- String represents the command with all arguments. The arguments must be separated by exactly one space.
The rest of paramter and return see executeCmdLine(String[], ...).int executeCmdLine(java.lang.ProcessBuilder processBuilder, java.lang.String cmd, java.lang.String input, int nReportLevel, java.lang.Appendable output, java.lang.Appendable error)
processBuilder
- The ProcessBuilder. There may be assigned environment variables and a current directory.cmd
- The cmd and arguments. If it is null, the command assigened to the processBuilder is used.input
- Any pipe-input. It may be null.nReportLevel
- The report level which is used for output.
If it is 0, then the output isn't written TODOoutput
- The output pipe. If it is null, the the outputs were not be captured while the process is running.
The output of the process can be read after finishing this routine calling processBuilder.getOutputStream()error
- The error pipe. If it is null, then errors are written in the output pipe.int executeCmdLine(java.lang.ProcessBuilder processBuilder, java.lang.String[] cmd, java.lang.String input, int nReportLevel, java.lang.Appendable output, java.lang.Appendable error)
processBuilder
- The ProcessBuilder. There may be assigned environment variables and a current directory.cmd
- The cmd and arguments. If it is null, the command assigend to the processBuilder is used.input
- Any pipe-input. It may be null.nReportLevel
- The report level which is used for output.
If it is 0, then the output isn't written TODOoutput
- The output pipe.error
- The error pipe. If it is null, then errors are written in the output pipe.int startCmdLine(java.lang.ProcessBuilder processBuilder, java.lang.String cmd)
cmd
- The command. Some arguments are possible, they should be separated by space.processBuilder
- The processBuilder.int startCmdLine(java.lang.ProcessBuilder processBuilder, java.lang.String[] cmd)
cmd
- The command and some arguments.processBuilder
- The processBuilder.int switchToWindowOrStartCmdline(java.lang.ProcessBuilder processBuilder, java.lang.String sCmd, java.lang.String sWindowTitle)
cmd
- The command and some arguments.processBuilder
- The processBuilder.sWindowTitle
- The title or the start of the window if the process is running already.
Note: The title is depending from the application.
Sometimes the title starts with the associated file, forex calling windows-notepad.java.lang.String currdir()
java.lang.String setcurrdir(java.lang.String newdir)
currdir()
for this instance.newDir
- any String which should contain an absolute normalized valid path to an existing directory.
The path is not tested here, it should be tested in the user's application because it may be depending
on any user's condition.
Note: Use File.exists()
and then
File.getAbsoluteFile()
+ FileFunctions.normalizePath(CharSequence)
to check and convert the parameter.currdir()
.