src/main/java/io/arivera/oss/embedded/rabbitmq/apache/commons/io/FileUtils.java
public static void copyUrlToFile(URL source, File destination,
                                  int connectionTimeout, int readTimeout, Proxy proxy) throws IOException {
    URLConnection connection;
    if (proxy == null) {
      connection = source.openConnection();
    } else {
      connection = source.openConnection(proxy);
    }
    connection.setConnectTimeout(connectionTimeout);
    connection.setReadTimeout(readTimeout);
    InputStream input = connection.getInputStream();
    copyInputStreamToFile(input, destination);
  }
public static void copyUrlToFile(URL source, File destination,
                                  int connectionTimeout, int readTimeout, Proxy proxy) throws IOException {
    URLConnection connection;
    if (proxy == null) {
      connection = source.openConnection();
    } else {
      connection = source.openConnection(proxy);
    }
    connection.setConnectTimeout(connectionTimeout);
    connection.setReadTimeout(readTimeout);
    InputStream input = connection.getInputStream();
    copyInputStreamToFile(input, destination);
  }
public static void copyUrlToFile ( URL source , File destination , int connectionTimeout , int readTimeout , Proxy proxy ) throws IOException { URLConnection connection ; if ( proxy == null ) { connection = source . openConnection ( ) ; } else { connection = source . openConnection ( proxy ) ; } connection . setConnectTimeout ( connectionTimeout ) ; connection . setReadTimeout ( readTimeout ) ; InputStream input = connection . getInputStream ( ) ; copyInputStreamToFile ( input , destination ) ; }
Copies bytes from the URL <code>source</code> to a file
<code>destination</code>. The directories up to <code>destination</code>
will be created if they don't already exist. <code>destination</code>
will be overwritten if it already exists.

@param source            the <code>URL</code> to copy bytes from, must not be {@code null}
@param destination       the non-directory <code>File</code> to write bytes to
(possibly overwriting), must not be {@code null}
@param connectionTimeout the number of milliseconds until this method
will timeout if no connection could be established to the <code>source</code>
@param readTimeout       the number of milliseconds until this method will
timeout if no data could be read from the <code>source</code>
@param proxy             the proxy to use to open connection
@throws IOException if <code>source</code> URL cannot be opened
@throws IOException if <code>destination</code> is a directory
@throws IOException if <code>destination</code> cannot be written
@throws IOException if <code>destination</code> needs creating but can't be
@throws IOException if an IO error occurs during copying
Copies bytes from the URL <code > source< / code > to a file <code > destination< / code > . The directories up to <code > destination< / code > will be created if they don t already exist . <code > destination< / code > will be overwritten if it already exists .