protected void saveDataSourceFile()
throws Exception {
// DNS setting
// java.security.Security.setProperty("networkaddress.cache.negative.ttl",
// "0");
// java.security.Security.setProperty("networkaddress.cache.ttl", "0");
// System.setProperty("sun.net.inetaddr.ttl", "0");
// System.setProperty("sun.net.inetaddr.negative.ttl", "0");
int byteLength = 0;
int BUF_SIZE = 1024;
byte[] input_buffer = new byte[BUF_SIZE];
BufferedOutputStream outStream = null;
InputStream inStream = null;
try {
outStream = new BufferedOutputStream(new FileOutputStream("DEN.xml"), BUF_SIZE);
URLConnection urlCon = null;
URL url = new URL(urlAddress);
urlCon = url.openConnection();
urlCon.setConnectTimeout((int) 100000);
urlCon.setReadTimeout((int) 100000);
inStream = urlCon.getInputStream();
while ((byteLength = inStream.read(input_buffer, 0, BUF_SIZE)) > 0) {
outStream.write(input_buffer, 0, byteLength);
}
// Close streams.
outStream.flush();
} finally {
if (outStream != null) {
outStream.close();
}
if (inStream != null) {
inStream.close();
}
}
}