All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xbib.io.ftp.client.parser.FTPTimestampParser Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
package org.xbib.io.ftp.client.parser;

import java.time.ZonedDateTime;

/**
 * This interface specifies the concept of parsing an FTP server's timestamp.
 */
public interface FTPTimestampParser {

    String DEFAULT_DATE_FORMAT = "MMM d yyyy"; //Nov 9 2001

    String DEFAULT_RECENT_DATE_FORMAT = "MMM d HH:mm"; //Nov 9 20:06

    String NUMERIC_DATE_FORMAT = "yyyy-MM-dd HH:mm"; //2001-11-09 20:06


    /**
     * Parses the supplied date stamp parameter.  This parameter typically would
     * have been pulled from a longer FTP listing via the regular expression
     * mechanism.
     *
     * @param timestampStr - the timestamp portion of the FTP directory listing to be parsed
     * @return a {@link java.time.ZonedDateTime} object initialized to the date
     * parsed by the parser
     */
    ZonedDateTime parseTimestamp(String timestampStr);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy