Merge pull request #3495 from eclipse/jetty-9.4.x-3489-extraclasspath-splat-windows

Issue #3489 - Allowing JAR directory references on Windows
This commit is contained in:
Joakim Erdfelt 2019-03-28 08:19:06 -07:00 committed by GitHub
commit d0a5ba8d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,20 +279,29 @@ public class WebAppClassLoader extends URLClassLoader
while (tokenizer.hasMoreTokens()) while (tokenizer.hasMoreTokens())
{ {
String token = tokenizer.nextToken().trim(); String token = tokenizer.nextToken().trim();
Resource resource= _context.newResource(token);
if (LOG.isDebugEnabled())
LOG.debug("Path resource=" + resource);
if(token.endsWith("*")) if(token.endsWith("*"))
{ {
if(token.length() > 1) if(token.length() > 1)
{ {
token = token.substring(0, token.length() - 1); token = token.substring(0, token.length() - 1);
Resource resource= _context.newResource(token);
if (LOG.isDebugEnabled())
LOG.debug("Glob Path resource=" + resource);
resource= _context.newResource(token); resource= _context.newResource(token);
addJars(resource); addJars(resource);
} }
} else if (resource.isDirectory() && resource instanceof ResourceCollection) return;
}
Resource resource= _context.newResource(token);
if (LOG.isDebugEnabled())
LOG.debug("Path resource=" + resource);
if (resource.isDirectory() && resource instanceof ResourceCollection)
{
addClassPath(resource); addClassPath(resource);
}
else else
{ {
// Resolve file path if possible // Resolve file path if possible