This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
public boolean runExternal(String path) { boolean execute = false; try { Runtime rt = Runtime.getRuntime(); Process p = rt.exec(path); InputStream in = p.getInputStream(); OutputStream out = p.getOutputStream(); InputStream err = p.getErrorStream(); execute = true; } catch (IOException e) { e.printStackTrace(); } return execute; }
and I got this exception instead:
AFAIK the error=2 means that the file is not found, but I have specified the exact file path, can anyone tell me what is wrong actually?
vivien siu
Ranch Hand
Joined: Nov 10, 2005
Posts: 143
posted
0
ok, I solved the error. The correct code should be:
I didn't add the .bat extension
Although there are no errors now, SecurSign is not creating a new file for me in the specified new file path. Can anyone tell me how I should write the command so that SecurSign will take an old file, encrypt it with password, and save the encrypted file to a new location, which the encrypted file is not previously created before?
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35253
7
posted
0
Does the command work correctly on the command-line? Runtime.exec has some issues one needs to be aware of.
2 interesting things: 1. Secursign only works with PDF files. Previously I was testing using txt files 2. Even if it is a PDF file I'm using, if the path is too long, the command wouldn't work either. The command for SecurSign to run itself is already very long. I suggest that you put it under c: or e: what ever, then at most only make a folder and cram all the PDFs in there.