|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.mojo.macker.CommandLineBuilder
public class CommandLineBuilder
Helper class for storing long command lines inside a temporary file.
Typical usage:
builder = new CommandLineBuilder();
builder.addArg("--someoption");
builder.addArg("optionValue");
...
builder.saveArgs();
doSomething(builder.getCommandLineFile());
builder.dispose();
It will save options in builder.getCommandLineFile(). Options
will be stored one in a line. Options are saved in UTF-8 encoding.
| Constructor Summary | |
|---|---|
CommandLineBuilder(String name)
Creates a new instance of the builder. |
|
| Method Summary | |
|---|---|
void |
addArg(String arg)
Adds command line argument. |
void |
addArg(String arg1,
String arg2)
Adds two command line arguments. |
void |
dispose()
Explicity frees all resources associated with this instance. |
String |
getCommandLineFile()
Gets absolute path to the file with saved arguments. |
void |
saveArgs()
Saves options and made file available to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandLineBuilder(String name)
throws IOException
IOException - if problems with creating temporary file for storing command line occur| Method Detail |
|---|
public void addArg(String arg)
throws IOException
arg - command line argument to save
IOException - if problems with temporary file occur
public void addArg(String arg1,
String arg2)
throws IOException
addArg(String) two times.
arg1 - first command line argument to savearg2 - second command line argument to save
IOException - if problems with temporary file occur
public void saveArgs()
throws IOException
getCommandLineFile() to get the file the arguments are saved in.
IOException - if problems with temporary file occur
public String getCommandLineFile()
throws IOException
saveArgs() method.
IOExceptionpublic void dispose()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||