문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
java:ftp [2019/03/17 11:30] kwon37xi 만듦 |
java:ftp [2019/03/22 12:45] kwon37xi |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Java FTP ====== | ====== Java FTP ====== | ||
- | * [[: | + | * [[: |
* [[https:// | * [[https:// | ||
+ | ===== apache commons net FTPClient ===== | ||
+ | * [[https:// | ||
+ | | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== MockFtpServer ===== | ||
+ | * [[http:// | ||
+ | |||
+ | <code java> | ||
+ | public class FtpClientIntegrationTest { | ||
+ | |||
+ | private FakeFtpServer fakeFtpServer; | ||
+ | |||
+ | private FtpClient ftpClient; | ||
+ | |||
+ | @Before | ||
+ | public void setup() throws IOException { | ||
+ | fakeFtpServer = new FakeFtpServer(); | ||
+ | fakeFtpServer.addUserAccount(new UserAccount(" | ||
+ | |||
+ | FileSystem fileSystem = new UnixFakeFileSystem(); | ||
+ | fileSystem.add(new DirectoryEntry("/ | ||
+ | fileSystem.add(new FileEntry("/ | ||
+ | fakeFtpServer.setFileSystem(fileSystem); | ||
+ | fakeFtpServer.setServerControlPort(0); | ||
+ | |||
+ | fakeFtpServer.start(); | ||
+ | |||
+ | ftpClient = new FtpClient(" | ||
+ | ftpClient.open(); | ||
+ | } | ||
+ | |||
+ | @After | ||
+ | public void teardown() throws IOException { | ||
+ | ftpClient.close(); | ||
+ | fakeFtpServer.stop(); | ||
+ | } | ||
+ | } | ||
+ | </ | ||
===== 참조 ===== | ===== 참조 ===== | ||
+ | * [[https:// | ||
* [[https:// | * [[https:// | ||