Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,8 @@ protected String doInBackground(Void... args) {

if (dbFile.getAbsolutePath().endsWith(".zip")) {
// uncompress first
try {
final FileInputStream fileInputStream = new FileInputStream(dbFile.getAbsolutePath());
final ZipInputStream zip_stream = new ZipInputStream(new BufferedInputStream(fileInputStream));
try (FileInputStream fileInputStream = new FileInputStream(dbFile.getAbsolutePath());
ZipInputStream zip_stream = new ZipInputStream(new BufferedInputStream(fileInputStream))) {
ZipEntry zipEntry = zip_stream.getNextEntry();
if ((zipEntry != null) && zipEntry.isDirectory())
zipEntry = zip_stream.getNextEntry();
Expand Down Expand Up @@ -314,9 +313,6 @@ protected String doInBackground(Void... args) {
return msg;
}

zip_stream.close();
fileInputStream.close();

} catch (IOException e) {
String msg = "Could not open file";
JoH.static_toast_long(msg);
Expand Down Expand Up @@ -359,7 +355,7 @@ public void run() {

String result = DatabaseUtil.loadSql(xdrip.getAppContext(), dbFile.getAbsolutePath());
if (delete_file != null) delete_file.delete();
statusDialog.dismiss();;
statusDialog.dismiss();
return result;
}

Expand Down
Loading