import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
public class TestTime {
/**
* @param args
*/
public static void main(String[] args)throws Exception {
String url = null;
url="可以通过爬虫得到图片连接
HttpClient httpClient = new HttpClient();
GetMethod getMethod = new GetMethod(url);
httpClient.executeMethod(getMethod); //执行getMrthod
byte[] responseBody = getMethod.getResponseBody();
OutputStream out = new FileOutputStream(new File("D:\\"+1+".jpg"));
out.write(responseBody);
out.flush();
System.out.println("download success");
out.close();
}
}