in src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java [569:593]
protected void ensureParentDirs(ArchiveOutputStream out,
ResourceWithFlags r,
Set directoriesAdded)
throws IOException {
String[] parentStack = FileUtils.getPathStack(r.getName());
String currentParent = "";
int skip = r.getName().endsWith("/") ? 2 : 1;
for (int i = 0; i < parentStack.length - skip; i++) {
if ("".equals(parentStack[i])) continue;
currentParent += parentStack[i] + "/";
if (directoriesAdded.add(currentParent)) {
Resource dir = new Resource(currentParent, true,
System.currentTimeMillis(),
true);
ResourceWithFlags artifical =
new ResourceWithFlags(currentParent,
dir, r.getCollectionFlags(),
new ResourceFlags());
ArchiveEntry ent = entryBuilder.buildEntry(artifical);
out.putArchiveEntry(ent);
out.closeArchiveEntry();
}
}
}