summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-03-22 19:58:40 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-03-22 19:59:04 +0100
commit249ed1fc24d6c0482ba28fd0106ee3fffba938f8 (patch)
tree9a0175151304613e29d6d0cd9aadf1c1caa2681d
parentbe160292022b9fa5ec33224f32fc12db78aeb79b (diff)
downloadsonarqube-249ed1fc24d6c0482ba28fd0106ee3fffba938f8.tar.gz
sonarqube-249ed1fc24d6c0482ba28fd0106ee3fffba938f8.zip
SONAR-3224 update javadoc
-rw-r--r--sonar-server/src/main/java/org/sonar/server/plugins/ClassLoaderUtils.java20
1 files 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<String> listFiles(ClassLoader classLoader, String rootPath) {
return listResources(classLoader, rootPath, new Predicate<String>() {
@Override
@@ -74,8 +79,15 @@ public final class ClassLoaderUtils {
});
}
- public static Collection<String> listResources(ClassLoader classloader, String rootPath) {
- return listResources(classloader, rootPath, Predicates.<String>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<String> listResources(ClassLoader classLoader, String rootPath) {
+ return listResources(classLoader, rootPath, Predicates.<String>alwaysTrue());
}
public static Collection<String> listResources(ClassLoader classloader, String rootPath, Predicate<String> predicate) {