Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > listing dirs in...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 15797 of 16566
Post > Topic >>

listing dirs in current webapp...

by maya <maya778899@[EMAIL PROTECTED] > Feb 19, 2008 at 11:15 AM

hi, I'm trying to detect subdirectories in current webapp, not sure how 
to filter dirs from files that are not dirs..  found something here,
http://www.exampledepot.com/egs/java.io/GetFiles.html?l=rel

  File dir = new File("directoryName");

     String[] children = dir.list();
     if (children == null) {
         // Either dir does not exist or is not a directory
     } else {
         for (int i=0; i<children.length; i++) {
             // Get filename of file or directory
             String filename = children[i];
         }
     }


but it how do you tell it to filter dirs ONLY?????
   (once we do String[] children = dir.list(); we can't test for 
isDirectory() anymore, since isDirectory() method cannot be applied to 
strings..)

am simply trying to detect which files in current dir (i.e., current 
webapp) are directories..

thank you...
 




 5 Posts in Topic:
listing dirs in current webapp...
maya <maya778899@[EMAI  2008-02-19 11:15:05 
Re: listing dirs in current webapp...
Lew <lew@[EMAIL PROTEC  2008-02-19 11:45:07 
Re: listing dirs in current webapp...
Nigel Wade <nmw@[EMAIL  2008-02-19 17:42:45 
Re: listing dirs in current webapp...
maya <maya778899@[EMAI  2008-02-25 15:20:04 
Re: listing dirs in current webapp...
Lew <lew@[EMAIL PROTEC  2008-02-25 21:37:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 13:39:36 CST 2008.