Fix bug where directories wrongly adopted resources as their children.

This commit is contained in:
hns 2005-04-29 13:27:54 +00:00
parent 6c44c5fa66
commit 95dd5feb63

View file

@ -104,10 +104,14 @@ public final class ZipRepository extends AbstractRepository {
String eName = entry.getName(); String eName = entry.getName();
if (!eName.regionMatches(0, entryPath, 0, entryPath.length())) { if (!eName.regionMatches(0, entryPath, 0, entryPath.length())) {
// not a child of ours // names don't match - not a child of ours
continue; continue;
} }
String[] entrypath = StringUtils.split(eName, "/"); String[] entrypath = StringUtils.split(eName, "/");
if (depth > 0 && !shortName.equals(entrypath[depth-1])) {
// catch case where our name is Foo and other's is FooBar
continue;
}
// create new repositories and resources for all entries with a // create new repositories and resources for all entries with a
// path depth of this.depth + 1 // path depth of this.depth + 1