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...