implement FilenameFilter so there is no need for creating an anonymous inner class.

This commit is contained in:
hns 2002-10-25 15:23:54 +00:00
parent aa1b666fbd
commit cffd1ec20d

View file

@ -13,7 +13,7 @@ import java.io.*;
*/ */
public final class SkinManager { public final class SkinManager implements FilenameFilter {
Application app; Application app;
@ -85,12 +85,7 @@ public final class SkinManager {
protected Map getSkinFiles (String skinDir, Prototype proto) { protected Map getSkinFiles (String skinDir, Prototype proto) {
File dir = new File (skinDir.toString (), proto.getName ()); File dir = new File (skinDir.toString (), proto.getName ());
String[] skinNames = dir.list (new FilenameFilter () { String[] skinNames = dir.list (this);
public boolean accept (File d, String n) {
return n.endsWith (".skin");
}
}
);
if (skinNames == null || skinNames.length == 0) if (skinNames == null || skinNames.length == 0)
return null; return null;
HashMap map = new HashMap (); HashMap map = new HashMap ();
@ -101,4 +96,12 @@ public final class SkinManager {
} }
return map; return map;
} }
/**
* Implements java.io.FilenameFilter.accept()
*/
public boolean accept (File d, String n) {
return n.endsWith (".skin");
}
} }