• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to read a file  RSS feed

 
saravana kumar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a configuration file projectConfig.xml under myproject\context.

how to read this file from a java class?

Thanks
Saravana
 
Costa lamona
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1- create new File object, giving the path

2- create FileReader, and you can wrap it inside a BufferedReader

3- most likly you want to read until you find a piece of information or the end of file (-1)

4- don't forget to clase to empty resources
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!