Example usage for org.apache.commons.vfs2 FileContent setLastModifiedTime

List of usage examples for org.apache.commons.vfs2 FileContent setLastModifiedTime

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 FileContent setLastModifiedTime.

Prototype

void setLastModifiedTime(long modTime) throws FileSystemException;

Source Link

Document

Sets the last-modified timestamp of the file.

Usage

From source file:net.sourceforge.fullsync.fs.connection.CommonsVfsConnection.java

@Override
public final boolean writeFileAttributes(final File file) throws IOException {
    FileObject obj = base.resolveFile(file.getPath());
    FileContent content = obj.getContent();
    boolean setLastModified;
    if (FileType.FOLDER == obj.getType()) {
        setLastModified = canSetLastModifiedFolder;
    } else {//from www.  jav a2s .  c o m
        setLastModified = canSetLastModifiedFile;
    }
    if (setLastModified) {
        content.setLastModifiedTime(file.getLastModified());
    }
    return true;
}