FtpUtil.java测试 (淘淘商城第三课文件上传)
首先在common-taotao中创建一个utils包,复制FtpUtil.java到其中。然后如下:
@Test
public void testFtpUtil() throws Exception{
FileInputStream inputStream = new FileInputStream(new File("D://Document
\\pictures\\images\\201122.jpg"));
FtpUtil.upLoadFile("192.168.25.133","21","ftpuser","ftpuser","/home/ftpuser/www/images"
,"2517/05/13","hello.jpg","inputStream ");
}