Skip to content

Commit

Permalink
replace custom close with apache
Browse files Browse the repository at this point in the history
  • Loading branch information
azotzot committed Jul 6, 2024
1 parent 97e7952 commit 880e112
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import brut.directory.Directory;
import brut.directory.DirectoryException;
import brut.directory.FileDirectory;
import org.apache.commons.io.IOUtils;
import org.xmlpull.v1.XmlSerializer;

import java.io.*;
Expand Down Expand Up @@ -95,8 +96,8 @@ public void decodeManifest(File outDir) throws AndrolibException {
} catch (DirectoryException ex) {
throw new AndrolibException(ex);
} finally {
closeQuietly(inputStream);
closeQuietly(outputStream);
IOUtils.closeQuietly(inputStream);
IOUtils.closeQuietly(outputStream);
}

if (mApkInfo.hasResources()) {
Expand All @@ -118,16 +119,6 @@ public void decodeManifest(File outDir) throws AndrolibException {
}
}

private void closeQuietly(Closeable toClose) {
if (toClose != null) {
try {
toClose.close();
} catch (IOException e) {
LOGGER.warning(String.format("Can`t close: %s!!!", toClose));
}
}
}

public void updateApkInfo(File outDir) throws AndrolibException {
mResTable.initApkInfo(mApkInfo, outDir);
}
Expand Down

0 comments on commit 880e112

Please sign in to comment.