Browse Source

Handle case where a file cannot be unzipped.

online-level-zero-accounts-api-call
CalDescent 3 years ago
parent
commit
2343e739d1
  1. 8
      src/main/java/org/qortal/arbitrary/ArbitraryDataReader.java

8
src/main/java/org/qortal/arbitrary/ArbitraryDataReader.java

@ -468,12 +468,18 @@ public class ArbitraryDataReader {
throw new DataException(String.format("Unable to unzip file: %s", e.getMessage()));
}
// Replace filePath pointer with the uncompressed file path
if (!this.uncompressedPath.toFile().exists()) {
throw new DataException(String.format("Unable to unzip file: %s", this.filePath));
}
// Delete original compressed file
if (FilesystemUtils.pathInsideDataOrTempPath(this.filePath)) {
if (Files.exists(this.filePath)) {
Files.delete(this.filePath);
}
}
// Replace filePath pointer with the uncompressed file path
this.filePath = this.uncompressedPath;
}

Loading…
Cancel
Save