java - Very slow file copying to Windows network using JCIF -


i'm trying copy file local machine shared folder in windows server. function used.

public static void copyfileusingjcifs(final string domain, final string username, final string password, final string sourcepath, final string destinationpath) throws ioexception {     final ntlmpasswordauthentication auth = new ntlmpasswordauthentication(domain, username, password);     final smbfile sfile = new smbfile(destinationpath, auth);     final smbfileoutputstream smbfileoutputstream = new smbfileoutputstream(sfile);     final fileinputstream fileinputstream = new fileinputstream(new file(             sourcepath));      final byte[] buf = new byte[16384];     int len;     while ((len = fileinputstream.read(buf)) > 0) {         smbfileoutputstream.write(buf, 0, len);     }     fileinputstream.close();     smbfileoutputstream.close(); } 

i tried this answer, didn't work me. when normal copying(copy , paste) takes maximum of 8minutes 25mb file. when use java program using function taking more 20minutes. how can make copying faster? in advance.

in case helps others...i had similar issue, in other direction (slow copying windows using jcifs). issue resolved adding

    -djcifs.resolveorder=dns 

to property list. (the default inclusion of bcast -- send netbios name query broadcast 255.255.255.255 -- causing enormous delay.)


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -