code: public static long parseParametersForAgeLimit(Map<String, String> parameters)
              throws JournalException {
          String ageString =
                  ParameterHelper
                          .getOptionalStringParameter(parameters,
                                                      PARAMETER_JOURNAL_FILE_AGE_LIMIT,
                                                      DEFAULT_AGE_LIMIT);
          Pattern p = Pattern.compile("([0-9]+)([DHM]?)");
          Matcher m = p.matcher(ageString);
          if (!m.matches()) {
              throw new JournalException("Parameter '"
                      + PARAMETER_JOURNAL_FILE_AGE_LIMIT
                      + "' must be an integer number of seconds, optionally "
                      + "followed by 'D'(days), 'H'(hours), or 'M'(minutes), "
                      + "or a 0 to indicate no age limit");
          }
          long age = Long.parseLong(m.group(1)) * 1000;
          String factor = m.group(2);
          if ("D".equals(factor)) {
              age *= 24 * 60 * 60;
          } else if ("H".equals(factor)) {
              age *= 60 * 60;
          } else if ("M".equals(factor)) {
              age *= 60;
          }
          return age;
      }
docs: Get the age limit parameter (or let it default), and convert it to
  milliseconds.