File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ftp or http or what?

 
Stephen Huey
Ranch Hand
Posts: 618
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to figure out which technology to use. Here's what I need to do:
Currently, my boss goes to a website that displays a login form, and eventually he clicks his way to a listing of URLs to data files that need to be downloaded. This other company posting the information uses servlets to retrieve the data and construct these files dynamically (as far as I can tell). We're going to get much more data in, so I need to automate this process.
I initially assumed I would need to try to open an FTP connection to their site in Java, so I was looking at the Apache Commons Net package. I assume that then I'd have to post the initial forms (login, etc) in Java, and then parse the listing page to find the live URLs to the files. However, I don't want to do this (e.g. learn the Apache Commons Net API) if there's a simpler way. For instance, should I be able to use classes like HttpURLConnection in the java.net API to do all of my interaction with their site? All I know is that when I access their site, it's an https connection. If it's not as easy to use stuff that Sun provides, then by all means I'll try to do it with the Apache package.
Jerry Kreps gave me some advice in another post, but I don't want to start coding with that if my approach is not right!
Thanks for any advice,
Stephen
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTPS with URL is as simple as the lines marked as added a year ago:

You'll probably have to POST a form to log in. I haven't had great luck with sending POST data through URL. My last try in a JUnit test seemed to be sending everything twice. This was straight from a tutorial someplace on the web.

Hope some of that helps.
[ August 07, 2003: Message edited by: Stan James ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic