public void scan(File file) throws IOException {
InputStream stream = null;
- WebXml fragment = null;
+ WebXml fragment = new WebXml();
try {
File fragmentFile = new File(file, FRAGMENT_LOCATION);
InputSource source =
new InputSource(fragmentFile.toURI().toURL().toString());
source.setByteStream(stream);
- fragment = new WebXml();
parseWebXml(source, fragment, true);
}
} finally {
ExceptionUtils.handleThrowable(t);
}
}
- if (fragment == null) {
- fragments.put(file.toURI().toURL().toString(), fragment);
- } else {
- fragment.setURL(file.toURI().toURL());
- if (fragment.getName() == null) {
- fragment.setName(fragment.getURL().toString());
- }
- fragments.put(fragment.getName(), fragment);
+ fragment.setURL(file.toURI().toURL());
+ if (fragment.getName() == null) {
+ fragment.setName(fragment.getURL().toString());
}
+ fragments.put(fragment.getName(), fragment);
}
}
if (end != -1) {
int start = path.lastIndexOf('/', end);
name = path.substring(start + 1, end + 4);
+ } else if (isScanAllDirectories()){
+ int start = path.lastIndexOf('/');
+ name = path.substring(start + 1);
}
return name;
Correctly track changes to context.xml files and trigger redeployment
when copyXML is set to false. (markt)
</fix>
+ <fix>
+ <bug>50997</bug>: Relax the requirement that directories must have a
+ name ending in <code>.jar</code> to be treated as an expanded JAR file
+ by the default JarScanner. Based on patch by Rodion Zhitomirsky. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">