Results 1 to 4 of 4
  1. #1
    goklien is offline Member
    Join Date
    Jan 2011
    Location
    Bandung, Indonesia
    Posts
    6
    Rep Power
    0

    Default [ask] listfiles from folders inside a folder

    all..

    how to get listfiles of folders inside a folder? so we got some folders in a parent folder..and each folder has some files

    thanks

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    Look for a likely method in the File class.

    It can be used recursively as in this example from exampledepot.com

  3. #3
    pugazhendhi's Avatar
    pugazhendhi is offline Pugazhendhi
    Join Date
    May 2011
    Location
    Bangalore
    Posts
    20
    Rep Power
    0

    Default

    Step1: get path of ur dir.
    Step2: check that path is dir or not .,
    Step3: if its dir ., make recursion to that method and pass that path ., to the same method .,
    step4: if its file add to arraylist ., its path else do the recursion .,
    try to do code ., it ., if u have some problem then i will post my code ., u can have it as a sample
    :) Small word can mean it more ,.

  4. #4
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    6

    Wink

    Quote Originally Posted by pugazhendhi View Post
    ., if u have some problem then i will post my code ., u can have it as a sample
    ., Don't do it ., Spoon feeding the solution isn't the way here ,. Let the OP get it on his own .,

    I hope you understand ,.

    ,. Goldest .,
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

Similar Threads

  1. Searching through folder to find text inside all files
    By dazzabiggs in forum New To Java
    Replies: 3
    Last Post: 05-03-2011, 02:20 PM
  2. Replies: 9
    Last Post: 04-12-2011, 08:26 PM
  3. Replies: 0
    Last Post: 10-28-2010, 01:46 PM
  4. Replies: 4
    Last Post: 10-10-2009, 01:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •