Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copying JPG files from on server to another in Unix env

 
jasdeep parmar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic