URL url = new URL(\"ftp://user:pass@ftp.example.com/thefolder/\"); URLConnection connection = url.openConnection(); ... // List files in folder...
Check out this class I found. It's does the lifting for you. Class at nsftools.com
Example would be:
FTPConnection ftpConnect = new FTPConnection(); ftpConnect.connect("ftp.example.com"); ftpConnect.login("user","pass"); System.out.println(ftpConnect.listFiles());