使用org.apache.http包下的HttpResponse接收http请求,请求是直接能够下载图片或文件的url地址。
// httpResponse 是org.apache.http包下的HttpResponse;
InputStream content = httpResponse.getEntity().getContent();
private static final String FILE_TO = "d:\\download\\google.txt";
File file = new File(FILE_TO);
org.apache.commons.io.FileUtils.copyInputStreamToFile(inputStream, file);