• Post Reply Bookmark Topic Watch Topic
  • New Topic

running oggenc from a java app  RSS feed

 
George Kyrillos
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am writing a gui for oggenc in linux and at some point I call oggenc through the app. Because the filenames contain spaces i strip them off by replacing the " " with "\ " (linux escape character) with the org.apache.commons.lang.StringUtils.replace(String text, String repl, String with).
The code is:

But it doesn't work. It works fine if the filename has no spaces and the output of the command works ok on the terminal...

Any ideas?
Thanks in advance.
 
Jonathan Moore
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know much about Linux, but should you be escaping the space? If a windows filename has spaces you usually put quotes around it. Also if you use the exec(String[]) method you shouldn't need to escape or quote it - you should just be able to use:
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to escape or quote the spaces. The exec() method takes care of these details for you.

Layne
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!