Skip to content
Permalink
Browse files
should use yyyy instead of YYYY in SimpleDateFormat
  • Loading branch information
XenoAmess committed Jan 1, 2022
1 parent d803cfa commit e1d42c938f35ac32e2344fad2f806318a9749fc2
Showing 5 changed files with 12 additions and 12 deletions.
@@ -90,7 +90,7 @@ private static class MboxListener implements IMAPChunkListener {
volatile long lastSeq = -1;
private final String lineSeparator;
private final SimpleDateFormat DATE_FORMAT // for mbox From_ lines
= new SimpleDateFormat("EEE MMM dd HH:mm:ss YYYY");
= new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy");

// e.g. INTERNALDATE "27-Oct-2013 07:43:24 +0000"
// for parsing INTERNALDATE
@@ -184,7 +184,7 @@ private static void writeFile(final POP3Client pop3, final OutputStreamWriter fw

private static void writeMbox(final POP3Client pop3, final OutputStreamWriter fw, final int i) throws IOException {
final SimpleDateFormat DATE_FORMAT // for mbox From_ lines
= new SimpleDateFormat("EEE MMM dd HH:mm:ss YYYY");
= new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy");
final String replyTo = "MAILER-DAEMON"; // default
final Date received = new Date();
try (final BufferedReader r = (BufferedReader) pop3.retrieveMessage(i)) {
@@ -993,7 +993,7 @@ public int mdtm(final String file) throws IOException
* receive the reply, and return the reply code.
*
* @param pathname The pathname for which mtime is to be changed
* @param timeval Timestamp in <code>YYYYMMDDhhmmss</code> format
* @param timeval Timestamp in <code>yyyyMMDDhhmmss</code> format
* @return The reply code received from the server.
* @throws FTPConnectionClosedException
* If the FTP server prematurely closes the connection as a result
@@ -1891,11 +1891,11 @@ public boolean getListHiddenFiles() {
/**
* Issue the FTP MDTM command (not supported by all servers) to retrieve the last
* modification time of a file. The modification string should be in the
* ISO 3077 form "YYYYMMDDhhmmss(.xxx)?". The timestamp represented should also be in
* ISO 3077 form "yyyyMMDDhhmmss(.xxx)?". The timestamp represented should also be in
* GMT, but not all FTP servers honor this.
*
* @param pathname The file path to query.
* @return A string representing the last file modification time in <code>YYYYMMDDhhmmss</code> format.
* @return A string representing the last file modification time in <code>yyyyMMDDhhmmss</code> format.
* @throws IOException if an I/O error occurs.
* @since 2.0
*/
@@ -2943,7 +2943,7 @@ public boolean makeDirectory(final String pathname) throws IOException
/**
* Issue the FTP MDTM command (not supported by all servers) to retrieve the last
* modification time of a file. The modification string should be in the
* ISO 3077 form "YYYYMMDDhhmmss(.xxx)?". The timestamp represented should also be in
* ISO 3077 form "yyyyMMDDhhmmss(.xxx)?". The timestamp represented should also be in
* GMT, but not all FTP servers honor this.
*
* @param pathname The file path to query.
@@ -2963,7 +2963,7 @@ public Calendar mdtmCalendar(final String pathname) throws IOException {
/**
* Issue the FTP MDTM command (not supported by all servers) to retrieve the last
* modification time of a file. The modification string should be in the
* ISO 3077 form "YYYYMMDDhhmmss(.xxx)?". The timestamp represented should also be in
* ISO 3077 form "yyyyMMDDhhmmss(.xxx)?". The timestamp represented should also be in
* GMT, but not all FTP servers honor this.
*
* @param pathname The file path to query.
@@ -2987,7 +2987,7 @@ public FTPFile mdtmFile(final String pathname) throws IOException {
/**
* Issue the FTP MDTM command (not supported by all servers) to retrieve the last
* modification time of a file. The modification string should be in the
* ISO 3077 form "YYYYMMDDhhmmss(.xxx)?". The timestamp represented should also be in
* ISO 3077 form "yyyyMMDDhhmmss(.xxx)?". The timestamp represented should also be in
* GMT, but not all FTP servers honor this.
*
* @param pathname The file path to query.
@@ -3746,14 +3746,14 @@ public void setListHiddenFiles(final boolean listHiddenFiles) {
* Issue the FTP MFMT command (not supported by all servers) which sets the last
* modified time of a file.
*
* The timestamp should be in the form <code>YYYYMMDDhhmmss</code>. It should also
* The timestamp should be in the form <code>yyyyMMDDhhmmss</code>. It should also
* be in GMT, but not all servers honor this.
*
* An FTP server would indicate its support of this feature by including "MFMT"
* in its response to the FEAT command, which may be retrieved by FTPClient.features()
*
* @param pathname The file path for which last modified time is to be changed.
* @param timeval The timestamp to set to, in <code>YYYYMMDDhhmmss</code> format.
* @param timeval The timestamp to set to, in <code>yyyyMMDDhhmmss</code> format.
* @return true if successfully set, false if not
* @throws IOException if an I/O error occurs.
* @since 2.2
@@ -97,7 +97,7 @@ public static FTPFile parseEntry(final String entry) {
}

/**
* Parse a GMT time stamp of the form YYYYMMDDHHMMSS[.sss]
* Parse a GMT time stamp of the form yyyyMMDDHHMMSS[.sss]
*
* @param timestamp the date-time to parse
* @return a Calendar entry, may be {@code null}
@@ -131,7 +131,7 @@ public static Calendar parseGMTdateTime(final String timestamp) {
}

/**
* Parse a GMT time stamp of the form YYYYMMDDHHMMSS[.sss]
* Parse a GMT time stamp of the form yyyyMMDDHHMMSS[.sss]
*
* @param timestamp the date-time to parse
* @return a Calendar entry, may be {@code null}

0 comments on commit e1d42c9

Please sign in to comment.