Skip to content

Commit

Permalink
Slight improvement to unzip logic
Browse files Browse the repository at this point in the history
  • Loading branch information
purplefox committed Jun 29, 2015
1 parent a5c0a61 commit 57de4f6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1557,14 +1557,14 @@ static private void unzipModuleData(final File directory, final ModuleZipInfo zi
}
} else {
File dir = entryFile.getParentFile();
if (dir != null && dir.isDirectory() && !dir.exists() && !dir.mkdirs()) {
throw new PlatformManagerException("Failed to create directory");
if (dir != null && !dir.exists() && !dir.mkdirs()) {
throw new PlatformManagerException("Failed to create parent directory");
}
int count;
byte[] buff = new byte[BUFFER_SIZE];
BufferedOutputStream dest = null;
try {
OutputStream fos = new FileOutputStream(new File(directory, entryName));
OutputStream fos = new FileOutputStream(entryFile);
dest = new BufferedOutputStream(fos, BUFFER_SIZE);
while ((count = zis.read(buff, 0, BUFFER_SIZE)) != -1) {
dest.write(buff, 0, count);
Expand Down

0 comments on commit 57de4f6

Please sign in to comment.