• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with recursion and files  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to read dirs whitin dirs with the following attached funcion. The second time I call the function no subdirs are found. If someone have any suggestions pleas help me.
Thank you
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ztopher,
I think you are using to much extra coding that is not required. You only need a File object and should not keep sending in the result list. Also the fileFilter is not really required because you can just use the isFile function. If the item found is not a file then it must be a directory. With those changes your code looks like the following:

Regards,
Manfred.
 
Martin Swift
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you !
Isn�t a good idea to pass the ArrayList as an argument to the function, like this?

In your version there is no point in using a collection or am I mistaken?
Cheers
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the intermediate forum...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!