• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading files from Folder

 
P.Praveen Jesudhas
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there a way to read, files present in a folder iteratively in a particular logic using any predefined classes in java api.

Thanks in advance
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the java.io.File API.
There you will find methods to list all files inside a specified folder.
You can iterate through the list and read the contents of the individual file by using streams.
 
Peter Lawrey
Ranch Hand
Posts: 62
 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by P.Praveen Jesudhas:
Hi,

Is there a way to read, files present in a folder iteratively in a particular logic using any predefined classes in java api.

Thanks in advance


Here is the Sample Code:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!