public class XMLFilter implements FileFilter {
public static String XML_FILEEXTENSION = ".xml";
public boolean accept(File pathname) {
if (pathname.isDirectory() ||
(pathname.isFile() &&
strFilename.endsWith(XML_FILEEXTENSION))
) {
return true;
}
return false;
}
}
should do the trick.
Lars
Am Dienstag 23 September 2008 14:38:13 schrieb steff aka sid:
> public class XMLFilter implements FileFilter {
>
> public static String XML_FILEEXTENSION = ".xml";
>
> public boolean accept(File pathname) {
> System.out.println(pathname);
> String strFilename = pathname.getName();
> if (strFilename.endsWith(XML_FILEEXTENSION)) {
> return true;
> }
> return false;
> }
> }