I have a abc.jar(It is used as archive for applet) in my folder vineet.And I a getting the position of vineet folder through getting the enviorment variable(I have set that for it).Now I am using third party api which generates some output in some directory xxx.Now I want my abc.jar in xxx
Can we copy it using ResourceAsStream or something like that ,I just want to copy jar file frome one location to another
Joined: Mar 22, 2005
So you don't want to do this from the command line, you want to do this using Java code? Searching for "java file copy" or some such term will find code to do that.
I think the overhead of creating a new process, reading its streams (When Runtime.exec() won't) and waiting for it to exit, will cause this solution to be much slower than any Java-only solution. So just use FileInputStream + FileOutputStream and start copying contents.