Hi
Can some one show me how to write a java program to download a file from a secure server https?
url=https://www.fededirectory.frb.org/FedACHdir.txt
Currently I am able to download file from http but got certificate issue when trying to download from https.
Here is the code:
-----------
public static void main(String args[]) throws IOException {
java.io.BufferedInputStream in =
new java.io.BufferedInputStream(
new java
.net
.URL("
https://www.fededirectory.frb.org/FedACHdir.txt").openStream());
java.io.FileOutputStream fos =new java.io.FileOutputStream("c:/bankInfo.txt");
java.io.BufferedOutputStream bout = new BufferedOutputStream(fos, 1024);
byte[] data = new byte[1024];
int x = 0;
while ((x = in.read(data, 0, 1024)) >= 0) {
bout.write(data, 0, x);
}
bout.close();
in.close();
System.out.println("File Downloaded");
}
-----------
Thanks