You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
method private void initialize(File odfFile) is not close ZipHelper mZipFile (is ZipHelper).
mZipFile.close (); should be called before the method exits.
// Initialize using temporary directory on hard disc
private void initialize(File odfFile) throws Exception {
mBaseURI = getBaseURIFromFile(odfFile);
if (mTempDirParent == null) {
/*
* getParentFile() returns already java.io.tmpdir when package is an
* odfStream
*/
mTempDirParent = odfFile.getAbsoluteFile().getParentFile();
if (!mTempDirParent.canWrite())
mTempDirParent = null; // java.io.tmpdir will be used implicitly
}
try {
mZipFile = new ZipHelper(new ZipFile(odfFile));
} catch (Exception e) {
if (odfFile.length() < 3)
throw new IllegalArgumentException("The empty file '"
+ odfFile.getPath() + "' is no ODF package!", e);
throw new IllegalArgumentException("Could not unzip the file "
+ odfFile.getPath(), e);
}
Enumeration<? extends ZipEntry> entries = mZipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry zipEntry = entries.nextElement();
mZipEntries.put(zipEntry.getName(), zipEntry);
/*
* TODO: think about if the additional list mPackageEntries is
* necessary - shouldn't everything be part of one of the other
* lists? maybe keep this as "master", rename it?
*/
mPackageEntries.add(zipEntry.getName());
if (zipEntry.getName().equals(
OdfPackage.OdfFile.MEDIA_TYPE.getPath())) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
StreamHelper.stream(mZipFile.getInputStream(zipEntry), out);
try {
mMediaType = new String(out.toByteArray(), 0, out.size(),
"UTF-8");
} catch (UnsupportedEncodingException ex) {
mLog.log(Level.SEVERE, null, ex);
}
}
}
mZipFile.close();// <-- add this line
}
The text was updated successfully, but these errors were encountered:
method private void initialize(File odfFile) is not close ZipHelper mZipFile (is ZipHelper).
mZipFile.close (); should be called before the method exits.
The text was updated successfully, but these errors were encountered: