How to copy file from smb share to local drive using jcifs in Java?

前端 未结 5 1709
后悔当初
后悔当初 2020-12-06 19:07

Could anybody help me to copy file from shared folder to local drive? My code is:

import jcifs.smb.NtlmPasswordAuthentication;
import jcifs.smb.SmbFile;
impo         


        
5条回答
  •  一向
    一向 (楼主)
    2020-12-06 19:57

    maybe adding auth to the second file:

    SmbFile dest = new SmbFile ("C:/SQLRESTORESTAGE/v2.bak",**auth**);
    

    using SmbFile dest = new SmbFile ("C:/SQLRESTORESTAGE",auth).canWrite you know if you have write permissions on the parent directory

提交回复
热议问题