/** * Add MDRecord to database * * @param request * @param ingestedRecords */ protected void addMdRecord2Database(Request request, List<RecordRepox> ingestedRecords) { try { Repox2Sip repox2Sip = RepoxContextUtil.getRepoxManager().getDataManager().getRepox2sip(); List<MetadataRecord> allMetadataRecords = new ArrayList<MetadataRecord>(); for (RecordRepox rp : ingestedRecords) { allMetadataRecords.add(rp.createRecordSip()); // rp.addRecord2DataBase(request.getId(), repox2Sip); } repox2Sip.addMetadataRecords(request.getId(), allMetadataRecords); } catch (Repox2SipException e) { log.error("Could not add MetadataRecord to Data Base", e); e.printStackTrace(); } }
public List<String> getLogFilenames() { File logDir = getLogsDir(); List<File> logDirnames = Arrays.asList(logDir.listFiles()); List<String> logFilenames = new ArrayList<String>(); for (File logMonthDir : logDirnames) { if (logMonthDir.isDirectory() && logMonthDir.listFiles().length > 0) { for (File logFile : logMonthDir.listFiles()) { if (logFile.getName().endsWith(".log")) { logFilenames.add(logMonthDir.getName() + File.separator + logFile.getName()); } } } } Collections.sort(logFilenames, new LogFilenameComparator()); Collections.reverse(logFilenames); return logFilenames; }