Solved

GET csv file over HTTPS ?

Posted on 2002-07-25
3
183 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:brian_s
  • 2
3 Comments
 
LVL 92

Expert Comment

by:objects
Comment Utility
> 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.
0
 

Author Comment

by:brian_s
Comment Utility
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!
0
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
Comment Utility
> our client requested that the file be echoed back?  
> should I just explain to them that, "TCP/IP guarantees
> correct packet delivery afaik."

It would probably be worth discussing with them to determine their exact reasons for this. Personally I'd consider it unnecessary if the purpose is to confirm correct delivery. Maybe suggests sending a checksum if there are concerns. But in the end it's up to the client what they want.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now