2015-04-13 12:05:00 +02:00
|
|
|
package processing.app.tools;
|
|
|
|
|
|
|
|
import org.apache.commons.exec.CommandLine;
|
|
|
|
import processing.app.BaseNoGui;
|
|
|
|
import processing.app.Platform;
|
|
|
|
import processing.app.helpers.OSUtils;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
2015-04-24 12:03:41 +02:00
|
|
|
public class DoubleQuotedArgumentsOnWindowsCommandLine extends CommandLine {
|
2015-04-13 12:05:00 +02:00
|
|
|
|
2015-04-24 12:03:41 +02:00
|
|
|
public DoubleQuotedArgumentsOnWindowsCommandLine(String executable) {
|
2015-04-13 12:05:00 +02:00
|
|
|
super(executable);
|
|
|
|
}
|
|
|
|
|
2015-04-24 12:03:41 +02:00
|
|
|
public DoubleQuotedArgumentsOnWindowsCommandLine(File executable) {
|
2015-04-13 12:05:00 +02:00
|
|
|
super(executable);
|
|
|
|
}
|
|
|
|
|
2015-04-24 12:03:41 +02:00
|
|
|
public DoubleQuotedArgumentsOnWindowsCommandLine(CommandLine other) {
|
2015-04-13 12:05:00 +02:00
|
|
|
super(other);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public CommandLine addArgument(String argument, boolean handleQuoting) {
|
2015-04-24 12:03:41 +02:00
|
|
|
if (argument.contains("\"") && OSUtils.isWindows()) {
|
|
|
|
argument = argument.replace("\"", "\\\"");
|
2015-04-13 12:05:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return super.addArgument(argument, handleQuoting);
|
|
|
|
}
|
|
|
|
}
|