[
https://issues.apache.org/jira/browse/EXEC-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14935920#comment-14935920
]
Sebb commented on EXEC-94:
--------------------------
An alternative would be to overload the addArgument() method with another
boolean parameter but that might be confusing, and is awkward to use.
[However a private method with that signature might well be useful]
The "raw" addArgument method should be the preferred way of handling arguments,
because AFAICT it avoids the need to perform any quoting.
When passed as separate arguments, the target application should receive the
arguments without any shell interpretation.
> CommandLine unconditionally trims arguments
> -------------------------------------------
>
> Key: EXEC-94
> URL: https://issues.apache.org/jira/browse/EXEC-94
> Project: Commons Exec
> Issue Type: Bug
> Reporter: Sebb
>
> The CommandLine private Argument class unconditionally trims argument values.
> This is wrong; it should be possible to pass arguments as-is to the executor.
> Fixing this unilaterally might break some code, so it is probably necessary
> to introduce a new method, for example:
> addRawArgument(String)
> This should save the exact argument without trimming and without quoting.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)