So I have this FTP server with a bunch of folders and files inside.
My program needs to access this server, read all of the files, and display their data.
For de
File
objects cannot handle an FTP
connection, you need to use a URLConnection
:
URL url = new URL ("ftp://username:password@www.superland.example/server");
URLConnection urlc = url.openConnection();
InputStream is = urlc.getInputStream();
...
Consider as an alternative FTPClient
from Apache Commons Net which has support for many protocols. Here is an FTP list files example.