Click to See Complete Forum and Search --> : Downloading HTML with JAVA


Aeren
11-23-2005, 04:30 AM
Hi everyone!

I would like to make a program, which can download, then show a site, defined by the URL(kinda like a browser, but very limited functions). Showing is not a problem, but how can i download the HTM file along with the other files(especially pictures and stylesheets are important). What i need is like the browsers do when "Save As" is pressed. I guess the HTM file should be changed as well(for downloaded files link), how should it be done nicely?

Thanks for the help!


Aeren

Khalid Ali
11-23-2005, 08:48 AM
you will need to use classes from the net package of java api's, once you connect to a url you will need to get the stream,
save the file in a "temp" directory or wherever,
once that is done then you will need to parse that page for any other resources that are used on that page such as JavaScript, stylesheets and images,
then indvidually download all of those after that you can view the page locally...

Aeren
11-23-2005, 09:22 AM
Can you please be a little more precise? I'm not very good in HTML.

Oak
11-23-2005, 09:43 AM
Its not really done in HTML its done in Java.

If you dont have a decent knowledge of Java then you are going to find it very challenging....

Aeren
11-28-2005, 04:38 PM
I've tried to use JEditorPane to show the page, but it doesn't really work.
I don't know if the links are the problem, but if i put in anything more complicated than text, it only beeps, and no picture. Anyone has an idea, which class is better than this?