On a linux box I am making the following SVN import
command:
svn import
--non-interactive
--trust-server-cert
--username username
--password password
-m "a message"
/path/to/local.zip
https://sub.domain.net/path/to/export.zip
When calling it from the command line myself it works without a problem.
However, if I make this call using a a Java command prompt then I receieve an error message that there are too many arguments in the import
command.
Does anyone know what could be causing this?
Additional notes
If I copy and paste the Java generated svn
import
command from my log file to the console then the import works as expected.I am able to use SVN
export
command from within Java without any problemsI have tried using single
'
quotes
Edit
The code to make these calls are as follows:
private void exportToSvn()
String command = String.format(
"svn import --non-interactive --trust-server-cert " +
"--username %s --password %s -m %s %s %s",
username, password, "\"a message\"", "/path/to/local.zip",
"https://sub.domain.net/path/to/export.zip"
);
command( command );
}
private void command( String... commands ) throws IOException, InterruptedException {
Runtime rt = Runtime.getRuntime();
for( String command : commands ){
Process pr = rt.exec( command );
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
logger.debug( command );
String line;
while ( (line = input.readLine()) != null)
logger.debug("> " + line);
}