aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/java/org/sonar/server/plugins/ClassLoaderUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-server/src/main/java/org/sonar/server/plugins/ClassLoaderUtils.java')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/plugins/ClassLoaderUtils.java10
1 files changed, 7 insertions, 3 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 9b971a24dc9..21c9df014bd 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
@@ -99,9 +99,7 @@ public final class ClassLoaderUtils {
URL root = classLoader.getResource(rootPath);
if (root != null) {
- if (!"jar".equals(root.getProtocol())) {
- throw new IllegalStateException("Unsupported protocol: " + root.getProtocol());
- }
+ checkJarFile(root);
// Path of the root directory
// Examples :
@@ -127,4 +125,10 @@ public final class ClassLoaderUtils {
throw Throwables.propagate(e);
}
}
+
+ private static void checkJarFile(URL root) {
+ if (!"jar".equals(root.getProtocol())) {
+ throw new IllegalStateException("Unsupported protocol: " + root.getProtocol());
+ }
+ }
}