|
|
@ -61,9 +61,11 @@ public class ServiceProviderExtensionFinder extends AbstractExtensionFinder { |
|
|
|
|
|
|
|
|
|
|
|
final Set<String> bucket = new HashSet<>(); |
|
|
|
final Set<String> bucket = new HashSet<>(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
URL url = getClass().getClassLoader().getResource(getExtensionsResource()); |
|
|
|
Enumeration<URL> urls = getClass().getClassLoader().getResources(getExtensionsResource()); |
|
|
|
if (url != null) { |
|
|
|
if (urls.hasMoreElements()) { |
|
|
|
collectExtensions(url, bucket); |
|
|
|
collectExtensions(urls, bucket); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
log.debug("Cannot find '{}'", getExtensionsResource()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
debugExtensions(bucket); |
|
|
|
debugExtensions(bucket); |
|
|
@ -90,10 +92,7 @@ public class ServiceProviderExtensionFinder extends AbstractExtensionFinder { |
|
|
|
try { |
|
|
|
try { |
|
|
|
Enumeration<URL> urls = ((PluginClassLoader) plugin.getPluginClassLoader()).findResources(getExtensionsResource()); |
|
|
|
Enumeration<URL> urls = ((PluginClassLoader) plugin.getPluginClassLoader()).findResources(getExtensionsResource()); |
|
|
|
if (urls.hasMoreElements()) { |
|
|
|
if (urls.hasMoreElements()) { |
|
|
|
while (urls.hasMoreElements()) { |
|
|
|
collectExtensions(urls, bucket); |
|
|
|
URL url = urls.nextElement(); |
|
|
|
|
|
|
|
collectExtensions(url, bucket); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
log.debug("Cannot find '{}'", getExtensionsResource()); |
|
|
|
log.debug("Cannot find '{}'", getExtensionsResource()); |
|
|
|
} |
|
|
|
} |
|
|
@ -109,6 +108,14 @@ public class ServiceProviderExtensionFinder extends AbstractExtensionFinder { |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void collectExtensions(Enumeration<URL> urls, Set<String> bucket) throws URISyntaxException, IOException { |
|
|
|
|
|
|
|
while (urls.hasMoreElements()) { |
|
|
|
|
|
|
|
URL url = urls.nextElement(); |
|
|
|
|
|
|
|
log.debug("Read '{}'", url.getFile()); |
|
|
|
|
|
|
|
collectExtensions(url, bucket); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void collectExtensions(URL url, Set<String> bucket) throws URISyntaxException, IOException { |
|
|
|
private void collectExtensions(URL url, Set<String> bucket) throws URISyntaxException, IOException { |
|
|
|
Path extensionPath; |
|
|
|
Path extensionPath; |
|
|
|
if (url.toURI().getScheme().equals("jar")) { |
|
|
|
if (url.toURI().getScheme().equals("jar")) { |
|
|
|