Skip to content

Commit

Permalink
Tweak file IO to fix transformation in Play prod mode (RPB-223)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Nov 8, 2024
1 parent b409bb5 commit da7b017
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/controllers/nwbib/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -30,7 +32,6 @@
import java.util.stream.StreamSupport;

import org.antlr.runtime.RecognitionException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.elasticsearch.common.base.Charsets;
import org.elasticsearch.common.geo.GeoPoint;
Expand Down Expand Up @@ -951,9 +952,9 @@ private static List<String> starredIds() {
public static Promise<Result> put(String id, String secret) throws FileNotFoundException, RecognitionException, IOException {
File input = new File("conf/output/test-output-strapi.json");
File output = new File("conf/output/test-output-0.json");
FileUtils.writeStringToFile(input, request().body().asJson().toString(), Charsets.UTF_8);
Files.write(Paths.get(input.getAbsolutePath()), request().body().asJson().toString().getBytes(Charsets.UTF_8));
ETL.main(new String[] {"conf/rpb-test-titel-to-lobid.flux"});
String result = FileUtils.readFileToString(output, Charsets.UTF_8);
String result = Files.readAllLines(Paths.get(output.getAbsolutePath())).stream().collect(Collectors.joining("\n"));
boolean authorized = !secret.trim().isEmpty() && secret.equals(CONFIG.getString("secret"));
if (authorized) {
String url = "http://weywot3:9200/resources-rpb-test/resource/"
Expand Down

0 comments on commit da7b017

Please sign in to comment.