Skip to content

Commit

Permalink
Downgraded Micronaut back to 3.0.0 as the issue is still prevelant ev…
Browse files Browse the repository at this point in the history
…en with the client forced. Fixed a NoSuchFileException for when associated files are not extractable.
  • Loading branch information
payammeyer committed Dec 29, 2021
1 parent f29431f commit 5b2c3e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ luceneVersion=8.9.0
mongoDriverVersion=4.4.0
grpcVersion=1.40.1
protobufVersion=3.17.3
micronautVersion=3.2.3
micronautVersion=3.0.0
2 changes: 1 addition & 1 deletion zulia-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ val micronautVersion: String by project
dependencies {
api(project(":zulia-common"))
implementation("com.google.code.gson:gson:2.8.6")
implementation("io.micronaut:micronaut-http-client:3.0.0") // forcing to working 3.0 until we switch to native java http client.
implementation("io.micronaut:micronaut-http-client:$micronautVersion") // forcing to working 3.0 until we switch to native java http client.
implementation("io.micronaut.reactor:micronaut-reactor-http-client:2.0.0")
}

15 changes: 9 additions & 6 deletions zulia-server/src/main/java/io/zulia/server/cmd/ZuliaCmdUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ public static void index(String inputDir, String recordsFilename, String idField
store.setResultDocument(new ResultDocBuilder().setDocument(document));
workPool.store(store);

if (Files.exists(Paths.get(inputDir + File.separator + id.replaceAll("/", "_") + ".zip"))) {
String fullPathToFile = inputDir + File.separator + id.replaceAll("/", "_") + ".zip";
if (Files.exists(Paths.get(fullPathToFile))) {

File destDir = new File(inputDir + File.separator + UUID.randomUUID() + "_tempWork");
byte[] buffer = new byte[1024];
try (ZipArchiveInputStream inputStream = new ZipArchiveInputStream(
new FileInputStream(Paths.get(inputDir + File.separator + id.replaceAll("/", "_") + ".zip").toFile()))) {
try (ZipArchiveInputStream inputStream = new ZipArchiveInputStream(new FileInputStream(Paths.get(fullPathToFile).toFile()))) {
ZipArchiveEntry zipEntry;
while ((zipEntry = inputStream.getNextZipEntry()) != null) {
decompressZipEntryToDisk(destDir, buffer, inputStream, zipEntry);
Expand Down Expand Up @@ -223,10 +223,13 @@ public static void index(String inputDir, String recordsFilename, String idField
}
}

}
// clean up temp work
Files.walk(destDir.toPath()).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);

// clean up temp work
Files.walk(destDir.toPath()).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
}
else {
//LOG.log(Level.SEVERE, "Could not extract file <" + fullPathToFile + ">");
}

}

Expand Down

0 comments on commit 5b2c3e7

Please sign in to comment.