public boolean canWrite ( ) throws SftpStatusException , SshException { // This is long hand because gcj chokes when it is not? Investigate why if ( ( getAttributes ( ) . getPermissions ( ) . longValue ( ) & SftpFileAttributes . S_IWUSR ) == SftpFileAttributes . S_IWUSR || ( getAttributes ( ) . getPermissions ( ) . longValue ( ) & SftpFileAttributes . S_IWGRP ) == SftpFileAttributes . S_IWGRP || ( getAttributes ( ) . getPermissions ( ) . longValue ( ) & SftpFileAttributes . S_IWOTH ) == SftpFileAttributes . S_IWOTH ) { return true ; } return false ; }
Determine whether the user has write access to the file . This checks the S_IWUSR flag is set in permissions .