Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading files in specified directory

 
Ravindra Suroju
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i read the files in specified directory?
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravindra Kumar S,
Welcome to JavaRanch.

For reading files from a directory you require to use InputStream classes.
You may use DataInputStream and/or FileInputStream and/or BufferedInputStream.

Also, you may like to view this tutorial. This may also be useful.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More useful tutorial from Sun here. Look for the link to file I/O especially.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic