Skip to content

Latest commit

 

History

History
71 lines (51 loc) · 1.64 KB

README.md

File metadata and controls

71 lines (51 loc) · 1.64 KB

FTPGG

本工程目的

封装一个Android下的FTP交互工具

本工程目标

1. 基于swiftp熟悉ftp

2. 基于ftp4j实现双向文件传输

本工程源码来源于swiftpftp4j,并会长期同步原作源码,部分内容可能会基于GPL协议稍作修改

关注本工程的盆友可转至原工程查看源码,感谢开源!

dependencies :

dependencies {
    //...
    implementation 'com.hd:ftpgg:1.0'
}

code :

about client
FcInfo fcInfo = new FcInfo.Builder()//
                   .setLoginUserName("ftp")//
                   .setLoginPassword("ftp")//
                   .setPort(3535)//
                   .build();
                   
//start-up client
FTPControl.startClient(fcInfo);

//stop client
FTPControl.stopClient(fcInfo);
about socket
FsInfo fsInfo = new FsInfo.Builder()//
                    .setAccountUserName("ftp")//
                    .setAccountPassword("ftp")//
                    .setAllowAnonymous(false)//
                    .setTakeFullWakeLock(true)//
                    .setChrootDirPath("")//
                    .setPortNumber(3535)//
                    .build();

//start-up socket
FTPControl.startSocket(fsInfo);

//stop socket
FTPControl.stopSocket(fsInfo);