Link to home
Start Free TrialLog in
Avatar of brian_s
brian_s

asked on

GET csv file over HTTPS ?

Hello I need to 1) get a csv file through an HTTPS connection and 2) echo the file back to ensure proper transmission. Where can I find sample code to do this? Or better yet... how do i do this...?

I'd been piecing together some code from reading some google posts.. here's what i have so far( I also downloaded JSSE from sun's site)-->



public void getDataOverSSL(){
try{
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.interal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

URL dataprovider = new URL("https://........");
URLConnection con = dataprovider.openConnection();
con.setDoInput(true);
con.setUseCaches(false);
BufferedReader buf = new BufferedReader(new InputStreamReader(con.getInputStream()));
String line;
while((line = buf.readLine()) != null){


} // end of while loop
}// end of try block
catch(Exception e){
System.err.println("Exception in DataXferHttps.getDataOverSSL");
e.printStackTrace();
}

} // end of getDataOverSSL
Avatar of Mick Barry
Mick Barry
Flag of Australia image

> 1) get a csv file through an HTTPS connection

What you're doing looks fine.

> and 2) echo the file back to ensure proper transmission.

Why?  TCP/IP guarantees correct packet delivery afaik.
Avatar of brian_s
brian_s

ASKER

objects...

thanks for looking my post(code) over-

our client requested that the file be echoed back?  should I just explain to them that, "TCP/IP guarantees correct packet delivery afaik."


well... as soon as i get the link from the client i'm going to give my code a try-  If it doesn't work and i can't figure it out, i'll post again here.  If it works i'll award you the points for  your time.

Thanks again!
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial