Example usage for org.apache.commons.net.ftp FTPCommand MDTM

List of usage examples for org.apache.commons.net.ftp FTPCommand MDTM

Introduction

In this page you can find the example usage for org.apache.commons.net.ftp FTPCommand MDTM.

Prototype

int MDTM

To view the source code for org.apache.commons.net.ftp FTPCommand MDTM.

Click Source Link

Usage

From source file:ch.cyberduck.core.ftp.FTPPath.java

@Override
public void readTimestamp() {
    if (this.attributes().isFile()) {
        try {/*from   w w  w .j av a 2  s .co m*/
            this.getSession().check();
            this.getSession().message(MessageFormat
                    .format(Locale.localizedString("Getting timestamp of {0}", "Status"), this.getName()));

            if (this.getSession().getClient().isFeatureSupported(FTPCommand.MDTM)) {
                final String timestamp = this.getSession().getClient().getModificationTime(this.getAbsolute());
                if (null != timestamp) {
                    attributes().setModificationDate(this.parseTimestamp(timestamp));
                }
            }
            if (-1 == attributes().getModificationDate()) {
                // Read the timestamp from the directory listing
                super.readTimestamp();
            }
        } catch (IOException e) {
            this.error("Cannot read file attributes", e);

        }
    }
}