Be defensive about creating directories for files

Maven 3.4 snapshots are now being published with invalid
zip files, where the entries are listed before their parent.
So the logic in the Installer is faulty: you have to mkdirs()
on all entries to be sure that the directory exists before you
write the file.
This commit is contained in:
Dave Syer 2016-11-03 16:35:17 +00:00 committed by rfscholte
parent 75a200a66e
commit 022fedb1bf
1 changed files with 1 additions and 0 deletions

View File

@ -170,6 +170,7 @@ public class Installer {
continue;
}
new File(dest, entry.getName()).getParentFile().mkdirs();
copyInputStream(zipFile.getInputStream(entry), new BufferedOutputStream(new FileOutputStream(new File(dest, entry.getName()))));
}
zipFile.close();