티스토리 뷰
LAF/J API를 활용한 FTP 접속 및 다운로드 입니다.
. . import lafx.protocol.ftp.*; . . . 중략 . . . LFTPServiceEntity serviceEntity = new LFTPServiceEntity(); serviceEntity.setServerIP("대상 서버 아이피"); serviceEntity.setUserID("접속 아이디"); serviceEntity.setUserPassword("접속 패스워드"); serviceEntity.setMode("접속모드"); // active 또는 passive모드 LFTPService ftpService = new LFTPService(serviceEntity); LFTPControl ftpControl = new LFTPControl(ftpService); // FTP 접속 ftpControl.ftpConnect(); // 파일 경로로 이동 ftpControl.cd("/"); ftpControl.cd("파일경로"); // 파일 다운로드 ftpControl.download("파일이름", "다운로드할경로+파일명'); //접속해제 ftpControl.quit(); . . . .
'Web-backend > Java' 카테고리의 다른 글
JAVA의 GC의 종류 및 특징 (0) | 2019.06.26 |
---|---|
Spring-boot, MyBatis 로 구성된 REST API 개발 (0) | 2019.05.30 |
H2 Console 사용하기 (0) | 2017.05.02 |
댓글