diff options
-rw-r--r-- | util/src/org/aspectj/util/FileUtil.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/util/src/org/aspectj/util/FileUtil.java b/util/src/org/aspectj/util/FileUtil.java index 490a79921..0a24666c6 100644 --- a/util/src/org/aspectj/util/FileUtil.java +++ b/util/src/org/aspectj/util/FileUtil.java @@ -37,7 +37,16 @@ public class FileUtil { public static final FileFilter ALL = new FileFilter() { public boolean accept(File f) { return true; } }; - + public static final FileFilter DIRS_AND_WRITABLE_CLASSES + = new FileFilter() { + public boolean accept(File file) { + return ((null != file) + && (file.isDirectory() + || (file.canWrite() + && file.getName().toLowerCase().endsWith(".class")))); + } + }; + /** @return true if file path has a zip/jar suffix */ public static boolean hasZipSuffix(File file) { return ((null != file) && hasZipSuffix(file.getPath())); |