From 249ed1fc24d6c0482ba28fd0106ee3fffba938f8 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 22 Mar 2012 19:58:40 +0100 Subject: SONAR-3224 update javadoc --- .../org/sonar/server/plugins/ClassLoaderUtils.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sonar-server/src/main/java/org/sonar/server/plugins/ClassLoaderUtils.java b/sonar-server/src/main/java/org/sonar/server/plugins/ClassLoaderUtils.java index 66bfed510cb..c99e4b7debb 100644 --- a/sonar-server/src/main/java/org/sonar/server/plugins/ClassLoaderUtils.java +++ b/sonar-server/src/main/java/org/sonar/server/plugins/ClassLoaderUtils.java @@ -36,8 +36,6 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; /** - * TODO it this class needed in sonar-plugin-api ? - * * @since 2.15 */ public final class ClassLoaderUtils { @@ -65,6 +63,13 @@ public final class ClassLoaderUtils { return toDir; } + /** + * Finds files within a given directory and its subdirectories + * + * @param classLoader + * @param rootPath the root directory, for example org/sonar/sqale + * @return a list of relative paths, for example {"org/sonar/sqale/foo/bar.txt}. Never null. + */ public static Collection listFiles(ClassLoader classLoader, String rootPath) { return listResources(classLoader, rootPath, new Predicate() { @Override @@ -74,8 +79,15 @@ public final class ClassLoaderUtils { }); } - public static Collection listResources(ClassLoader classloader, String rootPath) { - return listResources(classloader, rootPath, Predicates.alwaysTrue()); + /** + * Finds directories and files within a given directory and its subdirectories + * + * @param classLoader + * @param rootPath the root directory, for example org/sonar/sqale + * @return a list of relative paths, for example {"org/sonar/sqale", "org/sonar/sqale/foo", "org/sonar/sqale/foo/bar.txt}. Never null. + */ + public static Collection listResources(ClassLoader classLoader, String rootPath) { + return listResources(classLoader, rootPath, Predicates.alwaysTrue()); } public static Collection listResources(ClassLoader classloader, String rootPath, Predicate predicate) { -- cgit v1.2.3