mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
strip leading slashes from name in ZipFile.getEntry
This is necessary to allow resource loading of the form Foo.class.getResourceAsStream("/foo.txt") from JAR files.
This commit is contained in:
@ -74,6 +74,9 @@ public class ZipFile {
|
||||
}
|
||||
|
||||
protected ZipEntry getEntry(EntryFactory factory, String name) {
|
||||
while (name.startsWith("/")) {
|
||||
name = name.substring(1);
|
||||
}
|
||||
Integer pointer = index.get(name);
|
||||
return (pointer == null ? null : factory.makeEntry(window, pointer));
|
||||
}
|
||||
|
Reference in New Issue
Block a user