Bugfix to AARLibrary

Some aar files do not have an explicit directory entry for every
object. Make sure we create the needed directories.

Change-Id: Ic79d8852b6cc48f2399794c4087507e8f9c3bbaf
parent 560b3724
...@@ -246,6 +246,12 @@ public class AARLibrary { ...@@ -246,6 +246,12 @@ public class AARLibrary {
throw new IOException("Unable to create directory " + path.getAbsolutePath()); throw new IOException("Unable to create directory " + path.getAbsolutePath());
} else if (!entry.isDirectory()) { } else if (!entry.isDirectory()) {
try { try {
// Need to make sure the parent directory is present. Files can appear
// in a ZIP (AAR) file without an explicit directory object
File parentDir = target.getParentFile();
if (!parentDir.exists()) {
parentDir.mkdirs();
}
output = new FileOutputStream(target); output = new FileOutputStream(target);
input = zip.getInputStream(entry); input = zip.getInputStream(entry);
IOUtils.copy(input, output); IOUtils.copy(input, output);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment