Class SftpFileAttributes

java.lang.Object
com.sshtools.common.sftp.SftpFileAttributes
Type Parameters:
SSH_FILEXFER_TYPE_FIFO -

public class SftpFileAttributes extends Object
This class represents the ATTRS structure defined in the draft-ietf-secsh-filexfer-02.txt which is used by the protocol to store file attribute information.
Author:
Lee David Painter
  • Field Details

    • SSH_FILEXFER_ATTR_SIZE

      public static final long SSH_FILEXFER_ATTR_SIZE
      See Also:
    • SSH_FILEXFER_ATTR_UIDGID

      public static final long SSH_FILEXFER_ATTR_UIDGID
      See Also:
    • SSH_FILEXFER_ATTR_PERMISSIONS

      public static final long SSH_FILEXFER_ATTR_PERMISSIONS
      See Also:
    • SSH_FILEXFER_ATTR_ACCESSTIME

      public static final long SSH_FILEXFER_ATTR_ACCESSTIME
      See Also:
    • SSH_FILEXFER_ATTR_EXTENDED

      public static final long SSH_FILEXFER_ATTR_EXTENDED
      See Also:
    • VERSION_3_FLAGS

      public static final long VERSION_3_FLAGS
      See Also:
    • SSH_FILEXFER_ATTR_CREATETIME

      public static final long SSH_FILEXFER_ATTR_CREATETIME
      See Also:
    • SSH_FILEXFER_ATTR_MODIFYTIME

      public static final long SSH_FILEXFER_ATTR_MODIFYTIME
      See Also:
    • SSH_FILEXFER_ATTR_ACL

      public static final long SSH_FILEXFER_ATTR_ACL
      See Also:
    • SSH_FILEXFER_ATTR_OWNERGROUP

      public static final long SSH_FILEXFER_ATTR_OWNERGROUP
      See Also:
    • SSH_FILEXFER_ATTR_SUBSECOND_TIMES

      public static final long SSH_FILEXFER_ATTR_SUBSECOND_TIMES
      See Also:
    • VERSION_4_FLAGS

      public static final long VERSION_4_FLAGS
      See Also:
    • SSH_FILEXFER_ATTR_BITS

      public static final long SSH_FILEXFER_ATTR_BITS
      See Also:
    • VERSION_5_FLAGS

      public static final long VERSION_5_FLAGS
      See Also:
    • SSH_FILEXFER_ATTR_ALLOCATION_SIZE

      public static final long SSH_FILEXFER_ATTR_ALLOCATION_SIZE
      See Also:
    • SSH_FILEXFER_ATTR_TEXT_HINT

      public static final long SSH_FILEXFER_ATTR_TEXT_HINT
      See Also:
    • SSH_FILEXFER_ATTR_MIME_TYPE

      public static final long SSH_FILEXFER_ATTR_MIME_TYPE
      See Also:
    • SSH_FILEXFER_ATTR_UNTRANSLATED

      public static final long SSH_FILEXFER_ATTR_UNTRANSLATED
      See Also:
    • SSH_FILEXFER_ATTR_CTIME

      public static final long SSH_FILEXFER_ATTR_CTIME
      See Also:
    • VERSION_6_FLAGS

      public static final long VERSION_6_FLAGS
      See Also:
    • SSH_FILEXFER_TYPE_REGULAR

      public static final int SSH_FILEXFER_TYPE_REGULAR
      See Also:
    • SSH_FILEXFER_TYPE_DIRECTORY

      public static final int SSH_FILEXFER_TYPE_DIRECTORY
      See Also:
    • SSH_FILEXFER_TYPE_SPECIAL

      public static final int SSH_FILEXFER_TYPE_SPECIAL
      See Also:
    • SSH_FILEXFER_TYPE_UNKNOWN

      public static final int SSH_FILEXFER_TYPE_UNKNOWN
      See Also:
    • SSH_FILEXFER_TYPE_SOCKET

      public static final int SSH_FILEXFER_TYPE_SOCKET
      See Also:
    • SSH_FILEXFER_TYPE_CHAR_DEVICE

      public static final int SSH_FILEXFER_TYPE_CHAR_DEVICE
      See Also:
    • SSH_FILEXFER_TYPE_BLOCK_DEVICE

      public static final int SSH_FILEXFER_TYPE_BLOCK_DEVICE
      See Also:
    • SSH_FILEXFER_TYPE_FIFO

      public static final int SSH_FILEXFER_TYPE_FIFO
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_READONLY

      public static final int SSH_FILEXFER_ATTR_FLAGS_READONLY
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_SYSTEM

      public static final int SSH_FILEXFER_ATTR_FLAGS_SYSTEM
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_HIDDEN

      public static final int SSH_FILEXFER_ATTR_FLAGS_HIDDEN
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_CASE_INSENSITIVE

      public static final int SSH_FILEXFER_ATTR_FLAGS_CASE_INSENSITIVE
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_ARCHIVE

      public static final int SSH_FILEXFER_ATTR_FLAGS_ARCHIVE
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_ENCRYPTED

      public static final int SSH_FILEXFER_ATTR_FLAGS_ENCRYPTED
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_COMPRESSED

      public static final int SSH_FILEXFER_ATTR_FLAGS_COMPRESSED
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_SPARSE

      public static final int SSH_FILEXFER_ATTR_FLAGS_SPARSE
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_APPEND_ONLY

      public static final int SSH_FILEXFER_ATTR_FLAGS_APPEND_ONLY
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_IMMUTABLE

      public static final int SSH_FILEXFER_ATTR_FLAGS_IMMUTABLE
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_SYNC

      public static final int SSH_FILEXFER_ATTR_FLAGS_SYNC
      See Also:
    • SSH_FILEXFER_ATTR_FLAGS_TRANSLATION_ERR

      public static final int SSH_FILEXFER_ATTR_FLAGS_TRANSLATION_ERR
      See Also:
    • SFX_ACL_CONTROL_INCLUDED

      public static final int SFX_ACL_CONTROL_INCLUDED
      See Also:
    • SFX_ACL_CONTROL_PRESENT

      public static final int SFX_ACL_CONTROL_PRESENT
      See Also:
    • SFX_ACL_CONTROL_INHERITED

      public static final int SFX_ACL_CONTROL_INHERITED
      See Also:
    • SFX_ACL_AUDIT_ALARM_INCLUDED

      public static final int SFX_ACL_AUDIT_ALARM_INCLUDED
      See Also:
    • SFX_ACL_AUDIT_ALARM_INHERITED

      public static final int SFX_ACL_AUDIT_ALARM_INHERITED
      See Also:
    • SSH_FILEXFER_ATTR_KNOWN_TEXT

      public static final int SSH_FILEXFER_ATTR_KNOWN_TEXT
      See Also:
    • SSH_FILEXFER_ATTR_GUESSED_TEXT

      public static final int SSH_FILEXFER_ATTR_GUESSED_TEXT
      See Also:
    • SSH_FILEXFER_ATTR_KNOWN_BINARY

      public static final int SSH_FILEXFER_ATTR_KNOWN_BINARY
      See Also:
    • SSH_FILEXFER_ATTR_GUESSED_BINARY

      public static final int SSH_FILEXFER_ATTR_GUESSED_BINARY
      See Also:
    • S_IFMT

      public static final int S_IFMT
      Format mask constant can be used to mask off a file type from the mode.
      See Also:
    • S_MODE_MASK

      public static final int S_MODE_MASK
      Format mask constant to mask off file mode from the type.
      See Also:
    • S_IFSOCK

      public static final int S_IFSOCK
      Permissions flag: Identifies the file as a socket
      See Also:
    • S_IFLNK

      public static final int S_IFLNK
      Permissions flag: Identifies the file as a symbolic link
      See Also:
    • S_IFREG

      public static final int S_IFREG
      Permissions flag: Identifies the file as a regular file
      See Also:
    • S_IFBLK

      public static final int S_IFBLK
      Permissions flag: Identifies the file as a block special file
      See Also:
    • S_IFDIR

      public static final int S_IFDIR
      Permissions flag: Identifies the file as a directory
      See Also:
    • S_IFCHR

      public static final int S_IFCHR
      Permissions flag: Identifies the file as a character device
      See Also:
    • S_IFIFO

      public static final int S_IFIFO
      Permissions flag: Identifies the file as a pipe
      See Also:
    • S_ISUID

      public static final int S_ISUID
      Permissions flag: Bit to determine whether a file is executed as the owner
      See Also:
    • S_ISGID

      public static final int S_ISGID
      Permissions flag: Bit to determine whether a file is executed as the group owner
      See Also:
    • S_IRUSR

      public static final int S_IRUSR
      Permissions flag: Permits the owner of a file to read the file.
      See Also:
    • S_IWUSR

      public static final int S_IWUSR
      Permissions flag: Permits the owner of a file to write to the file.
      See Also:
    • S_IXUSR

      public static final int S_IXUSR
      Permissions flag: Permits the owner of a file to execute the file or to search the file's directory.
      See Also:
    • S_IRGRP

      public static final int S_IRGRP
      Permissions flag: Permits a file's group to read the file.
      See Also:
    • S_IWGRP

      public static final int S_IWGRP
      Permissions flag: Permits a file's group to write to the file.
      See Also:
    • S_IXGRP

      public static final int S_IXGRP
      Permissions flag: Permits a file's group to execute the file or to search the file's directory.
      See Also:
    • S_IROTH

      public static final int S_IROTH
      Permissions flag: Permits others to read the file.
      See Also:
    • S_IWOTH

      public static final int S_IWOTH
      Permissions flag: Permits others to write to the file.
      See Also:
    • S_IXOTH

      public static final int S_IXOTH
      Permissions flag: Permits others to execute the file or to search the file's directory.
      See Also:
  • Constructor Details

  • Method Details

    • acls

      public List<ACL> acls()
    • aclsFlag

      public com.sshtools.common.util.UnsignedInteger32 aclsFlag()
    • aclsFlagOr

      public Optional<com.sshtools.common.util.UnsignedInteger32> aclsFlagOr()
    • allocationSize

      public com.sshtools.common.util.UnsignedInteger64 allocationSize()
    • allocationSizeOr

      public Optional<com.sshtools.common.util.UnsignedInteger64> allocationSizeOr()
    • attributeBits

      public com.sshtools.common.util.UnsignedInteger32 attributeBits()
    • attributeBitsOr

      public Optional<com.sshtools.common.util.UnsignedInteger32> attributeBitsOr()
    • attributeBitsValid

      public com.sshtools.common.util.UnsignedInteger32 attributeBitsValid()
    • attributeBitsValidOr

      public Optional<com.sshtools.common.util.UnsignedInteger32> attributeBitsValidOr()
    • charsetEncoding

      public String charsetEncoding()
    • createTime

      public FileTime createTime()
    • createTimeOr

      public Optional<FileTime> createTimeOr()
    • extendedAttribute

      public byte[] extendedAttribute(String key)
    • extendedAttributeOr

      public Optional<byte[]> extendedAttributeOr(String key)
    • extendedAttributes

      public Map<String,byte[]> extendedAttributes()
    • flags

      public long flags()
    • getAccessedDateTime

      @Deprecated(since="3.1.0", forRemoval=true) public Date getAccessedDateTime()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getAccessedTime

      @Deprecated(since="3.1.0", forRemoval=true) public com.sshtools.common.util.UnsignedInteger64 getAccessedTime()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getCreationDateTime

      @Deprecated(since="3.1.0", forRemoval=true) public Date getCreationDateTime()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getCreationTime

      @Deprecated(since="3.1.0", forRemoval=true) public com.sshtools.common.util.UnsignedInteger64 getCreationTime()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getExtendedAttributes

      @Deprecated(since="3.1.0", forRemoval=true) public Map<String,byte[]> getExtendedAttributes()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getGID

      @Deprecated(since="3.1.0", forRemoval=true) public String getGID()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getMaskString

      @Deprecated(since="3.1.0", forRemoval=true) public String getMaskString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getModeType

      @Deprecated(since="3.1.0", forRemoval=true) public int getModeType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getModifiedDateTime

      @Deprecated(since="3.1.0", forRemoval=true) public Date getModifiedDateTime()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getModifiedTime

      @Deprecated(since="3.1.0", forRemoval=true) public com.sshtools.common.util.UnsignedInteger64 getModifiedTime()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getPermissionsString

      @Deprecated(since="3.1.0", forRemoval=true) public String getPermissionsString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getPosixPermissions

      @Deprecated(since="3.1.0", forRemoval=true) public PosixPermissions getPosixPermissions()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getSize

      @Deprecated(since="3.1.0", forRemoval=true) public com.sshtools.common.util.UnsignedInteger64 getSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • getType

      @Deprecated(since="3.1.0", forRemoval=true) public int getType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.
      Returns:
      type
      See Also:
    • getUID

      @Deprecated(since="3.1.0", forRemoval=true) public String getUID()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • gid

      public int gid()
    • gidOr

      public Optional<Integer> gidOr()
    • group

      public String group()
    • groupOr

      public Optional<String> groupOr()
    • hasAccessTime

      @Deprecated(since="3.1.0", forRemoval=true) public boolean hasAccessTime()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • hasAclFlags

      public boolean hasAclFlags()
    • hasAllocationSize

      public boolean hasAllocationSize()
    • hasAttributeBits

      public boolean hasAttributeBits()
    • hasCreateTime

      public boolean hasCreateTime()
    • hasExtendedAttribute

      public boolean hasExtendedAttribute(String key)
    • hasGid

      public boolean hasGid()
    • hasGID

      @Deprecated(since="3.1.0", forRemoval=true) public boolean hasGID()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • hasGroup

      public boolean hasGroup()
    • hasLastAccessTime

      public boolean hasLastAccessTime()
    • hasLastAttributesModifiedTime

      public boolean hasLastAttributesModifiedTime()
    • hasLastModifiedTime

      public boolean hasLastModifiedTime()
    • hasModifiedTime

      @Deprecated(since="3.1.0", forRemoval=true) public boolean hasModifiedTime()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • hasPermissions

      public boolean hasPermissions()
    • hasSize

      public boolean hasSize()
    • hasSubSecondTimes

      public boolean hasSubSecondTimes()
    • hasSupportedAttributeBits

      public boolean hasSupportedAttributeBits()
    • hasSupportedAttributeMask

      public boolean hasSupportedAttributeMask()
    • hasUid

      public boolean hasUid()
    • hasUID

      @Deprecated(since="3.1.0", forRemoval=true) public boolean hasUID()
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • hasUsername

      public boolean hasUsername()
    • isAppendOnly

      public boolean isAppendOnly()
    • isArchive

      public boolean isArchive()
    • isAttributeBitSet

      public boolean isAttributeBitSet(long attributeBit)
    • isBlock

      public boolean isBlock()
    • isCaseInsensitive

      public boolean isCaseInsensitive()
    • isCharacter

      public boolean isCharacter()
    • isSpecial

      public boolean isSpecial()
    • isCompressed

      public boolean isCompressed()
    • isDirectory

      public boolean isDirectory()
    • isEncrypted

      public boolean isEncrypted()
    • isFifo

      public boolean isFifo()
    • isFile

      public boolean isFile()
    • isHidden

      public boolean isHidden()
    • isImmutable

      public boolean isImmutable()
    • isLink

      public boolean isLink()
    • isReadOnly

      public boolean isReadOnly()
    • isSocket

      public boolean isSocket()
    • isSparse

      public boolean isSparse()
    • isSync

      public boolean isSync()
    • isSubSecondTimes

      public boolean isSubSecondTimes()
    • isSystem

      public boolean isSystem()
    • lastAccessTime

      public FileTime lastAccessTime()
    • lastAccessTimeOr

      public Optional<FileTime> lastAccessTimeOr()
    • lastAttributesModifiedTime

      public FileTime lastAttributesModifiedTime()
    • lastAttributesModifiedTimeOr

      public Optional<FileTime> lastAttributesModifiedTimeOr()
    • lastModifiedTime

      public FileTime lastModifiedTime()
    • lastModifiedTimeOr

      public Optional<FileTime> lastModifiedTimeOr()
    • linkCount

      public int linkCount()
    • linkCountOr

      public Optional<Integer> linkCountOr()
    • mimeType

      public String mimeType()
    • mimeTypeOr

      public Optional<String> mimeTypeOr()
    • permissions

      public PosixPermissions permissions()
    • permissionsOr

      public Optional<PosixPermissions> permissionsOr()
    • removeExtendedAttribute

      @Deprecated(since="3.1.0", forRemoval=true) public void removeExtendedAttribute(String attrName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set a single extended attribute value.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      attrName - attribute name to remove
      See Also:
    • setExtendedAttribute

      @Deprecated(since="3.1.0", forRemoval=true) public void setExtendedAttribute(String attrName, byte[] attrValue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set a single extended attribute value.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      attrName - attribute name
      attrValue - attribute value
      See Also:
    • setExtendedAttributes

      @Deprecated(since="3.1.0", forRemoval=true) public void setExtendedAttributes(Map<String,byte[]> attributes)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set all the extended attributes. The keys should be of type String, as should the values.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      attributes - map of all extended attributes
      See Also:
    • setGID

      @Deprecated(since="3.1.0", forRemoval=true) public void setGID(String gid)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the GID of this file.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      gid - gid
      See Also:
    • setGroup

      @Deprecated(since="3.1.0", forRemoval=true) public void setGroup(String group)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the group of this file.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      group - group
      See Also:
    • setPermissions

      @Deprecated(since="3.1.0", forRemoval=true) public void setPermissions(PosixPermissions newPermissions)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the permissions using a PosixPermissions set, created by a PosixPermissions.PosixPermissionsBuilder.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      newPermissions - new permissions
    • setPermissions

      @Deprecated(since="3.1.0", forRemoval=true) public void setPermissions(String newPermissions)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the permissions from a string in the format "rwxr-xr-x"

      Deprecated. See setPermissions(PosixPermissions) for alternative.

      Parameters:
      newPermissions - new permissions string
    • setPermissions

      @Deprecated(since="3.1.0", forRemoval=true) public void setPermissions(com.sshtools.common.util.UnsignedInteger32 permissions)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the permissions of the file. This value should be a valid mask of the permissions flags defined within this class.
      Parameters:
      permissions - permssions
      See Also:
    • setPermissionsFromMaskString

      @Deprecated(since="3.1.0", forRemoval=true) public void setPermissionsFromMaskString(String mask)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set permissions given a UNIX style mask, for example '0644'

      Deprecated. See setPermissions(PosixPermissions) for alternative.

      Parameters:
      mask - mask
      Throws:
      IllegalArgumentException - if badly formatted string
    • setPermissionsFromUmaskString

      @Deprecated(since="3.1.0", forRemoval=true) public void setPermissionsFromUmaskString(String umask)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the permissions given a UNIX style umask, for example '0022' will result in 0022 ^ 0777.

      Deprecated. See setPermissions(PosixPermissions) for alternative.

      Parameters:
      umask -
      Throws:
      IllegalArgumentException - if badly formatted string
    • setSize

      @Deprecated(since="3.1.0", forRemoval=true) public void setSize(com.sshtools.common.util.UnsignedInteger64 size)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the size of the file.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      group - group
      See Also:
    • setTimes

      public void setTimes(com.sshtools.common.util.UnsignedInteger64 atime, com.sshtools.common.util.UnsignedInteger32 atime_nano, com.sshtools.common.util.UnsignedInteger64 mtime, com.sshtools.common.util.UnsignedInteger32 mtime_nano, com.sshtools.common.util.UnsignedInteger64 ctime, com.sshtools.common.util.UnsignedInteger32 ctime_nano)
      Deprecated.
      Sets SFTP v4 time attributes including sub-second times. If you pass a null value for any sub-second time it will be defaulted to zero. If you pass null value for any time value if will be not be included in the attributes and its sub-second value will also not be included.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      atime -
      atime_nano -
      mtime -
      mtime_nano -
      ctime -
      ctime_nano -
      See Also:
    • setTimes

      @Deprecated(since="3.1.0", forRemoval=true) public void setTimes(com.sshtools.common.util.UnsignedInteger64 atime, com.sshtools.common.util.UnsignedInteger64 mtime)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.
      Parameters:
      atime - atime
      mtime - mtime
      See Also:
    • setTimes

      @Deprecated(since="3.1.0", forRemoval=true) public void setTimes(com.sshtools.common.util.UnsignedInteger64 atime, com.sshtools.common.util.UnsignedInteger64 mtime, com.sshtools.common.util.UnsignedInteger64 ctime)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set SFTP v4 time attributes without any sub-second times.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      atime - last accessed time
      mtime - last modified time
      ctime - creation time
      See Also:
    • setUID

      @Deprecated(since="3.1.0", forRemoval=true) public void setUID(String uid)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the UID of the owner.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      uid - uid
      See Also:
    • setUsername

      @Deprecated(since="3.1.0", forRemoval=true) public void setUsername(String username)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the username of this file.

      Deprecated. At 3.2.0, SftpFileAttributes will become entirely immutable.

      Parameters:
      username - usernameuid
      See Also:
    • size

      public com.sshtools.common.util.UnsignedInteger64 size()
    • sizeOr

      public Optional<com.sshtools.common.util.UnsignedInteger64> sizeOr()
    • supportedAttributeBits

      public long supportedAttributeBits()
    • supportedAttributeBitsOr

      public Optional<Long> supportedAttributeBitsOr()
    • supportedAttributeMask

      public long supportedAttributeMask()
    • supportedAttributeMaskOr

      public Optional<Long> supportedAttributeMaskOr()
    • textHint

      public byte textHint()
    • textHintOr

      public Optional<Byte> textHintOr()
    • toByteArray

      public byte[] toByteArray(int version) throws IOException
      Returns a formatted byte array suitable for encoding into SFTP subsystem messages.
      Returns:
      byte[]
      Throws:
      IOException
    • toMaskString

      public String toMaskString()
    • toModeType

      public int toModeType()
    • toPermissionsString

      public String toPermissionsString()
    • type

      public int type()
    • uid

      public int uid()
    • uidOr

      public Optional<Integer> uidOr()
    • untranslatedName

      public String untranslatedName()
    • untranslatedNameOr

      public Optional<String> untranslatedNameOr()
    • username

      public String username()
    • usernameOr

      public Optional<String> usernameOr()
    • bestUsernameOr

      public Optional<String> bestUsernameOr()
    • bestUsername

      public String bestUsername()
    • bestGroupOr

      public Optional<String> bestGroupOr()
    • bestGroup

      public String bestGroup()