public class NetCommand
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Commandline |
commandLine
what is the command line
|
protected Execute |
executable
executable
|
protected boolean |
failOnError
flag to control action on execution trouble
|
protected Task |
owner
owner project
|
protected java.lang.String |
program
actual program to invoke
|
protected java.lang.String |
title
title of the command
|
protected boolean |
traceCommandLine
trace flag
|
| Constructor and Description |
|---|
NetCommand(Task owner,
java.lang.String title,
java.lang.String program)
constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addArgument(java.lang.String argument)
add an argument to a command line; do nothing if the arg is null or
empty string
|
void |
addArgument(java.lang.String argument1,
java.lang.String argument2)
concatenate two strings together and add them as a single argument,
but only if argument2 is non-null and non-zero length
|
void |
addArguments(java.lang.String[] arguments)
add an argument to a command line; do nothing if the arg is null or
empty string
|
int |
getAutomaticResponseFileThreshold()
getter for threshold
|
boolean |
getFailFailOnError()
query fail on error flag
|
boolean |
isUseResponseFile()
getter
|
protected void |
logError(java.lang.String msg)
error text log
|
protected void |
logVerbose(java.lang.String msg)
verbose text log
|
protected void |
prepareExecutor()
set up the command sequence..
|
void |
runCommand()
Run the command using the given Execute instance.
|
int |
scanOneFileset(DirectoryScanner scanner,
java.util.Hashtable filesToBuild,
long outputTimestamp)
scan through one fileset for files to include
|
void |
setAutomaticResponseFileThreshold(int automaticResponseFileThreshold)
set threshold for automatically using response files -use 0 for off
|
void |
setDirectory(java.io.File directory)
set the directory to run from, if the default is inadequate
|
void |
setFailOnError(boolean b)
set fail on error flag
|
void |
setTraceCommandLine(boolean b)
turn tracing on or off
|
void |
setUseResponseFile(boolean useResponseFile)
set this to true to always use the response file
|
protected Task owner
protected Execute executable
protected Commandline commandLine
protected java.lang.String title
protected java.lang.String program
protected boolean traceCommandLine
protected boolean failOnError
public NetCommand(Task owner, java.lang.String title, java.lang.String program)
title - (for logging/errors)owner - owner taskprogram - app we are to runpublic void setTraceCommandLine(boolean b)
b - trace flagpublic void setFailOnError(boolean b)
b - fail flag -set to true to cause an exception to be raised if
the return value != 0public boolean getFailFailOnError()
public void setDirectory(java.io.File directory)
directory - the directory to use.protected void logVerbose(java.lang.String msg)
msg - string to add to log if verbose is defined for the buildprotected void logError(java.lang.String msg)
msg - message to display as an errorpublic void addArgument(java.lang.String argument)
argument - The feature to be added to the Argument attributepublic void addArguments(java.lang.String[] arguments)
arguments - The features to be added to the Argument attributepublic void addArgument(java.lang.String argument1,
java.lang.String argument2)
argument1 - The first argumentargument2 - The second argumentpublic boolean isUseResponseFile()
public void setUseResponseFile(boolean useResponseFile)
useResponseFile - a boolean value.public int getAutomaticResponseFileThreshold()
public void setAutomaticResponseFileThreshold(int automaticResponseFileThreshold)
automaticResponseFileThreshold - the threshold value to use.protected void prepareExecutor()
public void runCommand()
throws BuildException
BuildException - if something goes wrong and the
failOnError flag is truepublic int scanOneFileset(DirectoryScanner scanner, java.util.Hashtable filesToBuild, long outputTimestamp)
scanner - the directory scanner to use.filesToBuild - the map to place the files.outputTimestamp - timestamp to compare against