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();
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库java做的比较完善的FTP上传下载文件服务器源码(4)在线全文阅读。
相关推荐: