java做的比较完善的FTP上传下载文件服务器源码(4)

2021-04-05 14:06

java做的比较完善的FTP上传下载文件服务器源码

System.out.println(message);

log(RWFileDir,message);

}

}

public boolean downloadFile(String RWFileDir,String filepathname){

boolean result=true;

String message = "";

if (aftp != null)

{

System.out.println("正在下载文件"+filepathname+",请等待....");

String badfile

filepathname.substring(filepathname.length()-4,filepathname.length()); String badlog

filepathname.substring(filepathname.length()-7,filepathname.length()); = = String baddir = "";

if ((pareTo(".bad") != 0) && (pareTo(".badlog") != 0)){ baddir = "subunsubtosp\\";

}

else{

baddir = "bad\\";

} 字串9

String strdir = "subunsubtosp\\";

//System.out.println(RWFileDir + baddir + filepathname);

try{

//FtpClient fc=new FtpClient("192.168.0.56",2121);

//fc.login("lee","lee");

int ch;

File fi = new File(RWFileDir + baddir + filepathname);

//aftp.cd(strdir);

RandomAccessFile getFile = new RandomAccessFile(fi,"rw");

getFile.seek(0);

TelnetInputStream fget=aftp.get(strdir+filepathname);

DataInputStream puts = new DataInputStream(fget);

while ((ch = puts.read()) >= 0) {

getFile.write(ch);

}

//s.delete(); 字串1

fget.close();

getFile.close();

//fc.closeServer();


java做的比较完善的FTP上传下载文件服务器源码(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:缺表测电阻七例十法

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: