How to use a proxy and force fetching the latest data

I just recently had a problem using a Java URLConnection behind a proxy and forcing the connection to get the latest available data on the server and not the one cached by the proxy. The following code snippet demonstrate how to do that.

10
11
12
13
URL metarUrl = new URL("ftp://tgftp.nws.noaa.gov:21/data/observations/metar/stations/LSGG.TXT");
Proxy myProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("www.myproxy.ch", 8080));
URLConnection metarConnection = metarUrl.openConnection(myProxy);
metarConnection.setDefaultUseCaches(false);