Apr 02

You can use URL class to access an ftp server by using the ftp protocol with the URL


URL url = new URL("ftp://username:password@ftp.xyz.com/file.txt");

The URL can then be used to open a connection to the URL and read the contents

If you need more functionality than simply pulling files from the ftp server then some other options include:

  • Sun’s undocumented class sun.net.ftp.FtpClient
  • Jakarta Commons Net library

written by objects \\ tags: , , ,

Dec 09

Set the following system properties

  • ftp.proxyHost
  • ftp.proxyPort

java -Dftp.proxyHost=proxy.objects.com.au -Dftp.proxyPort=80 au.com.objects.MyApplication

To do the same programatically use the System classess setProperty() method

   System.setProperty("ftp.proxyHost", proxyHostname);
   System.setProperty("ftp.proxyPort", proxyPort);

written by objects \\ tags: , ,