I don’t understand the difference between these methods.
Here’s what the JavaDoc says:
setLine(String) = Line to split into several commandline arguments.
setValue(String) = Sets a single commandline argument.
My confusion is that I see them being used interchangeably in the code I’m updating. An example:
Commandline commandline;
commandline = new Commandline(new File(jarUtilsDir,"signtool.exe").getAbsolutePath());
commandline.createArgument().setLine("--verbosity");
commandline.createArgument().setValue("-1");
commandline.createArgument().setLine("-o");
Maybe I just need an explanation of how these are supposed to be used.
If you’re setting a single value without a space, it doesn’t matter. However, suppose you have:
that’s equivalent to:
whereas
will do appropriate quoting (I believe) such that the program that’s called sees it as a single command line argument.
The easy way to test this is to create an app which just prints out its arguments, one per line, and try both ways 🙂