Downloader Sample Code

Hi,I'm Trying to make Desktop application that download specified File from web it's like download tool If any one know or have sample code or can help me with the code I抣l be grateful Regards,Charbel Asmar
[243 byte] By [MY_JAVA_FORUMa] at [2007-10-3 4:31:27]
# 1
C'mon people, ever heard of Google?!
SoulTech2012a at 2007-7-14 22:34:53 > top of Java-index,Desktop,Developing for the Desktop...
# 2

package frss.net;

import java.io.BufferedInputStream;

import java.io.BufferedOutputStream;

import java.io.File;

import java.io.FileOutputStream;

import java.io.InputStream;

import java.net.URL;

import java.net.URLConnection;

import frss.util.FR_Util;

public class FR_Recurso {

public FR_Recurso() {

}

public void descarga_recurso(String cadena_url, File destino) {

try {

if(destino.isDirectory()==false) {

URL url = new URL(cadena_url);

URLConnection connection = url.openConnection();

InputStream stream = connection.getInputStream();

BufferedInputStream in = new BufferedInputStream(stream);

FileOutputStream file = new FileOutputStream(destino.getAbsolutePath());

BufferedOutputStream out = new BufferedOutputStream(file);

int i;

while ((i = in.read()) != -1) {

out.write(i);

}

out.flush();

out.close();

FR_Util.trace("Se ha descargado el recurso: " + destino.getAbsolutePath());

}

else {

FR_Util.trace("El destino est?mal escrito, expresa un subdirectorio, no un archivo dentro de uno");

}

}

catch (Exception e) {

FR_Util.traceTipoDebug("Se ha producido un error " + e, this.getClass(), e);

}

}

}

The FR_Util class only print a message

FRSSa at 2007-7-14 22:34:53 > top of Java-index,Desktop,Developing for the Desktop...