LogRepositoryCustomImpl implements LogRepositoryCustom { public XLog importFromFile(XFactory factory, String location) throws Exception { if (location.endsWith("mxml.gz")) { return importFromInputStream(new FileInputStream(location), new XMxmlGZIPParser(factory)); } else if (location.endsWith("mxml")) { return importFromInputStream(new FileInputStream(location), new XMxmlParser(factory)); } else if (location.endsWith("xes.gz")) { return importFromInputStream(new FileInputStream(location), new XesXmlGZIPParser(factory)); } else if (location.endsWith("xes")) { return importFromInputStream(new FileInputStream(location), new XesXmlParser(factory)); } return null; }  @Override @SuppressWarnings("unchecked") List<Log> findAllLogs(final String conditions); @Override @SuppressWarnings("unchecked") List<Log> findAllLogsByFolder(final Integer folderId, final String userRowGuid, final String conditions); @Override String storeProcessLog(final Integer folderId, final String logName, XLog log, final Integer userID,
                                  final String domain, final String created); void deleteProcessLog(Log log); XLog getProcessLog(Log log, String factoryName); APMLog getAggregatedLog(Log log); String getLayoutByLogId(Integer logId, Integer userId); XLog importFromFile(XFactory factory, String location); void exportToFile(String path, String name, XLog log); XLog importFromInputStream(InputStream inputStream, XParser parser); void exportToInputStream(XLog log, String path, String name, XSerializer serializer);  }
@Test public void testImportFromFile() { System.out.println(ClassLoader.getSystemResource("XES_logs/SepsisCases.xes")); System.out.println(System.getProperty("user.dir")); try { String name = ClassLoader.getSystemResource("XES_logs/SepsisCases.xes").getPath(); System.out.println("name: " + name); XFactory factory = XFactoryRegistry.instance().currentDefault(); XLog log = logRepo.importFromFile(factory, name); System.out.println("log: " + log); XLogInfo logInfo = XLogInfoFactory.createLogInfo(log); System.out.println("logInfo: " + logInfo); readSequentially(log); } catch (Exception e) { System.out.println("Error " + e.getMessage()); } }