users@servlet-spec.java.net

[servlet-spec users] Inconsistency in implementations when unpacking empty directory entries from war files

From: Eirik Bjørsnøs <eirbjo_at_gmail.com>
Date: Thu, 15 Dec 2011 17:19:36 +0100

Experts of the Servlets,

When Glassfish unpacks a war file and encounters an empty directory
entry, it ignores the entry.

When Jetty unpacks the same war file, it creates a directory for the
entry in the destination path.

This leads to inconsistent behavior for web applications calling
ServletContext.getResourcePaths("/WEB-INF/") when "WEB-INF/classes/"
is an empty entry in the war file.

For me, this inconsistency creates noise when testing the
ResourceLoader implementations of GlassFish and Jetty, since the test
doesn't really know what to expect.

I can always work around it by adding files to the directory
(WEB-INF/classes/dontdelete.txt), but that's a pretty ugly hack.

Can the Expert Group please clarify the correct behavior for empty
directory entries, and I will follow up with a bug report and patches
to either Glassfish/Tomcat or Jetty.

(I know this is a minor detail, but that's what the world is made of :-)

Thanks,
Eirik.