use of com.cas.sim.tis.util.FTPUtils in project TeachingInSimulation by ScOrPiOzzy.
the class FileDownload method testUpload2.
@Test
public void testUpload2() throws Exception {
// 管理员可以上传文件
FTPUtils util = getUtil("admin", "admin");
boolean result = util.uploadFile("/Test", new File("G:\\jfxrt.jar"), System.currentTimeMillis() + ".jar");
Assert.assertTrue(result);
}
use of com.cas.sim.tis.util.FTPUtils in project TeachingInSimulation by ScOrPiOzzy.
the class FileDownload method testDirectory.
@Test
public void testDirectory() throws Exception {
FTPUtils util = getUtil("anonymous", "");
boolean success = util.connect("Test001/Test002");
Assert.assertFalse(success);
}
use of com.cas.sim.tis.util.FTPUtils in project TeachingInSimulation by ScOrPiOzzy.
the class ClientConfig method buildFtpClient.
@Bean
public FTPUtils buildFtpClient() {
FTPUtils util = new FTPUtils();
FTPClient client = new FTPClient();
util.setFtpClient(client);
util.setHost(ftpAddress);
util.setPort(ftpPort);
util.setUsername("admin");
util.setPassword("admin");
try {
SocketTest.test(ftpAddress, ftpPort);
} catch (RuntimeException e) {
throw e;
}
return util;
}
Aggregations