• Post Reply Bookmark Topic Watch Topic
  • New Topic

Read an html file and print the contents to console  RSS feed

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i have an html file. i want to read the contents of this html file and print it to standard output.

i am new to java IO and streams. Please help me with some code snippets.

I am usng Oracle JDeveloper as the IDE.
 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Do you want to read the HTML document from the file system, or via http off a web-server?

If option 1, try something like:



if option 2, take a look first at java.net.HttpURLConnection and the getInputStream() method it inherits
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!