How to copy files over Network to LocalDrive in Java -


i need sample code copies files on network local file system in java. how done in java?

here code copies files in local file system

 file fromfile = new file("file");     file tofile = new file("../copiedfile");     tofile.createnewfile();     fileinputstream = new fileinputstream(fromfile);     fileoutputstream = new fileoutputstream(tofile);     byte [] buffer = new byte[4096];     int bytesread;     while ((bytesread = from.read(buffer)) != -1) {         to.write(buffer, 0, bytesread);     } 

i think, if want copy files on network should send buffer using objectoutput , sockets


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -