catch (NumberFormatException ex) {}
index++;
}
int dateTimePos = index;
Date lastModified = null;
StringBuffer stamp = new StringBuffer(fields[index++]);
stamp.append('-');
if (dayOfMonth > 0)
stamp.append(dayOfMonth);
else
stamp.append(fields[index++]);
stamp.append('-');
String field = fields[index++];
if (field.indexOf(':') < 0 && field.indexOf('.') < 0) {
stamp.append(field); // year
try {
lastModified = noHHmmFormatter.parse(stamp.toString());
}
catch (ParseException ignore) {
noHHmmFormatter = (noHHmmFormatter == noHHmmFormatter1 ? noHHmmFormatter2 : noHHmmFormatter1);
try {
lastModified = noHHmmFormatter.parse(stamp.toString());
}
catch (ParseException ex) {
if (!ignoreDateParseErrors)
throw new DateParseException(ex.getMessage());
}
}
}
else { // add the year ourselves as not present
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
stamp.append(year).append('-').append(field);
lastModified = parseTimestamp(stamp.toString());
// can't be in the future - must be the previous year
// add 2 days just to allow for different time zones
cal.add(Calendar.DATE, 2);
if (lastModified != null && lastModified.after(cal.getTime())) {
cal.setTime(lastModified);
cal.add(Calendar.YEAR, -1);
lastModified = cal.getTime();
}
}