java通过http url读取远程文件
try {
URL url = new URL("http://localhost:8080/VWdummy/VW/VW0001R/tgd/ja/test.txt");
InputStream is = url.openStream();
BufferedInputStream bis = new BufferedInputStream(is);
StringBuffer sb = new StringBuffer("");
int len = 0;
byte[] temp = new byte[1024];
while ((len = bis.read(temp)) != -1) {
sb.append(new String(temp, 0, len));
}
sb.toString();
} catch (IOException e) {
e.printStackTrace();
}