This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Copying JPG files from on server to another in Unix env Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Copying JPG files from on server to another in Unix env" Watch "Copying JPG files from on server to another in Unix env" New topic
Author

Copying JPG files from on server to another in Unix env

jasdeep parmar
Greenhorn

Joined: Oct 06, 2008
Posts: 20
hi,

I am copying, renaming a jpg file from one folder to another. I am able to do using FileImageOutputStream

File outFile = new File(destinationLoc+newName);
FileImageOutputStream output = new FileImageOutputStream(outFile);
writer.setOutput(output);
IIOImage image = new IIOImage(input, null, null);
System.out.println( "Writing " + 75 + "%");
writer.write(null, image, imagWritParam);

this works as long as the destinationLoc is on the same server but I am NOT sure how to pass destinationloc if I want to copy these files to other unix server on the network. I tried passing the url to that server and the file location but that doesn't work.

Does anybody know how can I do that, or please point me in direction where i can find resource to do that
thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

Depends what protocol you plan on using. Do you want to copy through Samba, FTP, NFS?

My advise would be to set up an NFS share on the machine to copy to, then mount it on the other machine. Then everything on that mounted NFS share appears to be local.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Consider Paul's rocket mass heater.
 
subject: Copying JPG files from on server to another in Unix env