服务器文件读取慢,JCIFS读取远程服务器文件过慢的解决方法

与windows explorer打开相同的文件相比,JCIFS默认状况下要慢太多了。我找了大半天,总算找出了解决方法,增长以下配置,则读取速度会有质的飞跃,我这边从7s提高至0.2s: html

System.setProperty("jcifs.smb.client.dfs.disabled", "true"); 至于缘由嘛,我也不知道,我是今后网站捞到的一条配置:

执行程序代码以下: windows

private static final int BUFFER_SIZE = 1024;

public static void main(String[]args) throws Exception {

//SmbFile file = new SmbFile("smb://finchina;daieel:[email protected]/Soft/sc8 key.txt");

//SmbFile file = new SmbFile("smb://10.15.97.181/xx部资料库/工做文档/查询逻辑.txt");d

//http://samba.2283325.n4.nabble.com/Peformance-questions-td4644647.html

System.setProperty("jcifs.smb.client.dfs.disabled", "true");

long startTime = System.currentTimeMillis();

UniAddress dc = UniAddress.getByName("192.168.100.5");

<
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值