diff options
author | Ola Aunrønning <ola.aunroe@gmail.com> | 2018-09-10 15:58:51 +0200 |
---|---|---|
committer | Ola Aunrønning <ola.aunroe@gmail.com> | 2018-09-10 15:58:51 +0200 |
commit | dd4f6af83ca7374d6458b4e31d2706a8684c43c8 (patch) | |
tree | 7b8c97014dcbe7661d7d6fe74a6d5e38b51146a4 /container-core/src/main/java/com/yahoo/container/handler/LogReader.java | |
parent | 44053e445e8f893514667325be40613830056e6e (diff) |
Check if container is running on logserver
Diffstat (limited to 'container-core/src/main/java/com/yahoo/container/handler/LogReader.java')
-rw-r--r-- | container-core/src/main/java/com/yahoo/container/handler/LogReader.java | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/LogReader.java b/container-core/src/main/java/com/yahoo/container/handler/LogReader.java index e35ea748c0e..eb00446dd0e 100644 --- a/container-core/src/main/java/com/yahoo/container/handler/LogReader.java +++ b/container-core/src/main/java/com/yahoo/container/handler/LogReader.java @@ -1,32 +1,20 @@ package com.yahoo.container.handler; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonGenerator; -import org.apache.commons.codec.binary.Base64; import org.json.JSONException; import org.json.JSONObject; import javax.xml.bind.DatatypeConverter; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; import java.nio.file.Files; public class LogReader { - protected static void writeToOutputStream(String logDirectory, OutputStream outputStream) throws IOException { - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream); + protected static JSONObject readLogs(String logDirectory) throws IOException, JSONException { JSONObject json = new JSONObject(); File root = new File(logDirectory); - try { - traverse_folder(root, json); - } catch (JSONException e) { - outputStreamWriter.write("Failed to create log JSON"); - } - outputStreamWriter.write(json.toString()); - outputStreamWriter.close(); + traverse_folder(root, json); + return json; } private static void traverse_folder(File root, JSONObject json) throws IOException, JSONException { |