use of org.apache.metron.rest.model.pcap.Pdml in project metron by apache.
the class PcapServiceImpl method getPdml.
@Override
public Pdml getPdml(String username, String jobId, Integer page) throws RestException {
Pdml pdml = null;
Path path = getPath(username, jobId, page);
try {
FileSystem fileSystem = getFileSystem();
if (path != null && fileSystem.exists(path)) {
String scriptPath = environment.getProperty(MetronRestConstants.PCAP_PDML_SCRIPT_PATH_SPRING_PROPERTY);
InputStream processInputStream = pcapToPdmlScriptWrapper.execute(scriptPath, fileSystem, path);
pdml = new XmlMapper().readValue(processInputStream, Pdml.class);
processInputStream.close();
}
} catch (IOException e) {
throw new RestException(e);
}
return pdml;
}
Aggregations