import com.att.eelf.configuration.EELFManager;
import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;
-import org.onap.aai.setup.SchemaVersion;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Map;
import java.util.Map.Entry;
+import org.onap.aai.setup.SchemaVersion;
+
/**
* JsonIngestor produces DocumentContexts from json files
*/
public class JsonIngestor {
- private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(JsonIngestor.class);
-
+ private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(JsonIngestor.class);
+
/**
* Reads in given json files to queryable DocumentContexts.
*
* @param filesToIngest - map of filenames to ingest
- * per Version
+ * per Version
* @return Map<SchemaVersion, List<DocumentContext>> - map of DocumentContexts per Version
*/
public Map<SchemaVersion, List<DocumentContext>> ingest(Map<SchemaVersion, List<String>> filesToIngest) {
*/
public String readInJsonFile(String rulesFilename) {
StringBuilder sb = new StringBuilder();
- try(BufferedReader br = new BufferedReader(new FileReader(rulesFilename))) {
+ try (BufferedReader br = new BufferedReader(new FileReader(rulesFilename))) {
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
}
} catch (IOException e) {
- LOGGER.warn("Exception in file"+e.getMessage());
+ LOGGER.warn("Exception in file" + e.getMessage());
throw new ExceptionInInitializerError(e);
}
return sb.toString();