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.
I have a file stored under directory called test on weblogic server. Weblogic is running on sun solaris machine. Now, i want to move this file from this test directory to another machine(totally a different machine to some specified directory) through java code ie., just like the way we scp from one machine to another machine on command prompt but thru java code. Is this possible? If so, please let me know how to do this, i am not too familiar with unix commands. Thanks. Appreciate your help.
If there's a network share in place - and you have write access to the target, you can just do a simple read/write loop. Basically, like this:
Exact format of the network file name may vary somewhat.
Customer surveys are for companies who didn't pay proper attention to begin with.
Steve Granton
Ranch Hand
Joined: Jan 13, 2002
Posts: 200
posted
0
Hi, This may be off on a tangent but may be useful. I'm fairly sure that you can call Ant (http://jakarta.apache.org/ant/index.html) from within java (since its written in java) and you could have an Ant task that ftps the files to the remote machine - you could also zip the files using Ant if they are large. Cheers, Steve
Mandy Smith
Ranch Hand
Joined: Jun 26, 2001
Posts: 62
posted
0
Thanks Steve. I liked your idea of scheduling the task to Ant. I am fairly new to Ant usage, so could you please post a sample code as to how Ant ftps to the remote machine. Thanks, Appreciate u'r help.