Exemple #1
0
  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;
  }
Exemple #2
0
  protected void checkRequest(boolean addedNewRecords, Request newRequest) {
    try {
      if (!addedNewRecords) {
        Repox2Sip repox2sip = RepoxContextUtil.getRepoxManager().getDataManager().getRepox2sip();
        List<Request> requestList = repox2sip.getDataSetRequests(this.getIdDb());

        Collections.sort(requestList, new DateSorter());
        for (Request request : requestList) {
          if (request.getStatus().equals(RequestStatus.IMPORT_COMPLETED)) {
            Long myId = request.getId();
            repox2sip.addMetadataRecords(
                newRequest.getId(), repox2sip.getRequestMetadataRecords(myId));
            break;
          }
        }
      }
    } catch (Repox2SipException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    }
  }