void setTimes()

in src/main/java/com/pastdev/jsch/nio/file/UnixSshFileSystemProvider.java [580:601]


    void setTimes( UnixSshPath path, FileTime lastModifiedTime, FileTime lastAccessTime ) throws IOException {
        if ( lastModifiedTime != null && lastModifiedTime.equals( lastAccessTime ) ) {
            String command = path.getFileSystem().getCommand( "touch" )
                    + " -t " + toTouchTime( lastModifiedTime )
                    + " " + path.toAbsolutePath().quotedString();
            executeForStdout( path, command );
            return;
        }

        if ( lastModifiedTime != null ) {
            String command = path.getFileSystem().getCommand( "touch" )
                    + " -m -t " + toTouchTime( lastModifiedTime )
                    + " " + path.toAbsolutePath().quotedString();
            executeForStdout( path, command );
        }
        if ( lastAccessTime != null ) {
            String command = path.getFileSystem().getCommand( "touch" )
                    + " -a -t " + toTouchTime( lastModifiedTime )
                    + " " + path.toAbsolutePath().quotedString();
            executeForStdout( path, command );
        }
    }