안녕하세요. 이전 질문에 답변이 안올라와 다시 문의드립니다.
commons-net-3.6 라이브러리의 FtpClient 클래스를 이용해 파일을 다운로드받습니다.
그런데 중간에 중지하는 방법을 모르겠습니다
어떻게 해야하나요 ?
for (int i = 0; i < files.length; i ++) {
if (files[i].getName().equals("download.dat")) {
File f1 = new File(dir + "/" + files[i].getName());
if (f1.exists())
f1.delete();
os = new FileOutputStream(f1);
startTime = System.currentTimeMillis();
boolean result = ftp.retrieveFile("download.dat", os);
break;
}
}