String url = "http://www.google.com.hk/logos/2010/stevenson10-hp.jpg";
HttpClient client = new HttpClient();
GetMethod get = new GetMethod(url);
try {
client.executeMethod(get);
File storeFile = new File("d:/1.jpg");
FileOutputStream fileOutputStream = new FileOutputStream(storeFile);
FileOutputStream output = fileOutputStream;
output.write(get.getResponseBody());
output.close();
} catch (HttpException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}