Skip to content

Commit

Permalink
#221 raise the file permission error properly
Browse files Browse the repository at this point in the history
  • Loading branch information
plrthink committed Feb 2, 2021
1 parent 6988f2e commit 1d34568
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions android/src/main/java/com/rnziparchive/RNZipArchiveModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -118,17 +116,9 @@ public void unzip(final String zipFilePath, final String destDirectory, final St
@Override
public void run() {
// Check the file exists
FileInputStream inputStream = null;
try {
inputStream = new FileInputStream(zipFilePath);
new File(zipFilePath);
} catch (FileNotFoundException | NullPointerException e) {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException ignored) {
}
}
} catch (NullPointerException e) {
promise.reject(null, "Couldn't open file " + zipFilePath + ". ");
return;
}
Expand Down

0 comments on commit 1d34568

Please sign in to comment.