Top Fields Constructors Methods
org.apache.sshd.sftp.client.fs

public Class SftpPosixFileAttributes

extends Object
implements PosixFileAttributes
Class Inheritance
All Implemented Interfaces
java.nio.file.attribute.PosixFileAttributes, java.nio.file.attribute.BasicFileAttributes
Imports
java.nio.file.Path, java.nio.file.attribute.FileTime, .GroupPrincipal, .PosixFileAttributes, .PosixFilePermission, .UserPrincipal, java.util.Set, org.apache.sshd.common.util.GenericUtils, org.apache.sshd.sftp.client.SftpClient.Attributes

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final SftpClient.Attributes
private final Path

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public FileTime
public Object
fileKey()

Implements java.nio.file.attribute.BasicFileAttributes.fileKey.

Returns an object that uniquely identifies the given file, or null if a file key is not available.

public final Path

Returns:

The referenced attributes file Path
getPath
()

public GroupPrincipal
group()

Implements java.nio.file.attribute.PosixFileAttributes.group.

Returns the group owner of the file.

public boolean
isDirectory()

Implements java.nio.file.attribute.BasicFileAttributes.isDirectory.

Tells whether the file is a directory.

public boolean
isOther()

Implements java.nio.file.attribute.BasicFileAttributes.isOther.

Tells whether the file is something other than a regular file, directory, or symbolic link.

public boolean
isRegularFile()

Implements java.nio.file.attribute.BasicFileAttributes.isRegularFile.

Tells whether the file is a regular file with opaque content.

public FileTime
lastAccessTime()

Implements java.nio.file.attribute.BasicFileAttributes.lastAccessTime.

Returns the time of last access.

public FileTime
lastModifiedTime()

Implements java.nio.file.attribute.BasicFileAttributes.lastModifiedTime.

Returns the time of last modification.

public UserPrincipal
owner()

Implements java.nio.file.attribute.PosixFileAttributes.owner.

Returns the owner of the file.

public Set<PosixFilePermission>
permissions()

Implements java.nio.file.attribute.PosixFileAttributes.permissions.

Returns the permissions of the file.

public long
size()

Implements java.nio.file.attribute.BasicFileAttributes.size.

Returns the size of the file (in bytes).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributesback to summary
private final SftpClient.Attributes attributes
pathback to summary
private final Path path

Constructor Detail

SftpPosixFileAttributesback to summary
public SftpPosixFileAttributes(Path path, SftpClient.Attributes attributes)

Method Detail

creationTimeback to summary
public FileTime creationTime()

Implements java.nio.file.attribute.BasicFileAttributes.creationTime.

Doc from java.nio.file.attribute.BasicFileAttributes.creationTime.

Returns the creation time. The creation time is the time that the file was created.

If the file system implementation does not support a time stamp to indicate the time when the file was created then this method returns an implementation specific default value, typically the last-modified-time or a FileTime representing the epoch (1970-01-01T00:00:00Z).

Returns:FileTime

a FileTime representing the time the file was created

Annotations
@Override
fileKeyback to summary
public Object fileKey()

Implements java.nio.file.attribute.BasicFileAttributes.fileKey.

Doc from java.nio.file.attribute.BasicFileAttributes.fileKey.

Returns an object that uniquely identifies the given file, or null if a file key is not available. On some platforms or file systems it is possible to use an identifier, or a combination of identifiers to uniquely identify a file. Such identifiers are important for operations such as file tree traversal in file systems that support symbolic links or file systems that allow a file to be an entry in more than one directory. On UNIX file systems, for example, the device ID and inode are commonly used for such purposes.

The file key returned by this method can only be guaranteed to be unique if the file system and files remain static. Whether a file system re-uses identifiers after a file is deleted is implementation dependent and therefore unspecified.

File keys returned by this method can be compared for equality and are suitable for use in collections. If the file system and files remain static, and two files are the same with non-null file keys, then their file keys are equal.

Returns:Object

an object that uniquely identifies the given file, or null

Annotations
@Override
getPathback to summary
public final Path getPath()
Returns:Path

The referenced attributes file Path

groupback to summary
public GroupPrincipal group()

Implements java.nio.file.attribute.PosixFileAttributes.group.

Doc from java.nio.file.attribute.PosixFileAttributes.group.

Returns the group owner of the file.

Returns:GroupPrincipal

the file group owner

Annotations
@Override
isDirectoryback to summary
public boolean isDirectory()

Implements java.nio.file.attribute.BasicFileAttributes.isDirectory.

Doc from java.nio.file.attribute.BasicFileAttributes.isDirectory.

Tells whether the file is a directory.

Returns:boolean

true if the file is a directory

Annotations
@Override
isOtherback to summary
public boolean isOther()

Implements java.nio.file.attribute.BasicFileAttributes.isOther.

Doc from java.nio.file.attribute.BasicFileAttributes.isOther.

Tells whether the file is something other than a regular file, directory, or symbolic link.

Returns:boolean

true if the file something other than a regular file, directory or symbolic link

Annotations
@Override
isRegularFileback to summary
public boolean isRegularFile()

Implements java.nio.file.attribute.BasicFileAttributes.isRegularFile.

Doc from java.nio.file.attribute.BasicFileAttributes.isRegularFile.

Tells whether the file is a regular file with opaque content.

Returns:boolean

true if the file is a regular file with opaque content

Annotations
@Override
lastAccessTimeback to summary
public FileTime lastAccessTime()

Implements java.nio.file.attribute.BasicFileAttributes.lastAccessTime.

Doc from java.nio.file.attribute.BasicFileAttributes.lastAccessTime.

Returns the time of last access.

If the file system implementation does not support a time stamp to indicate the time of last access then this method returns an implementation specific default value, typically the last-modified-time or a FileTime representing the epoch (1970-01-01T00:00:00Z).

Returns:FileTime

a FileTime representing the time of last access

Annotations
@Override
lastModifiedTimeback to summary
public FileTime lastModifiedTime()

Implements java.nio.file.attribute.BasicFileAttributes.lastModifiedTime.

Doc from java.nio.file.attribute.BasicFileAttributes.lastModifiedTime.

Returns the time of last modification.

If the file system implementation does not support a time stamp to indicate the time of last modification then this method returns an implementation specific default value, typically a FileTime representing the epoch (1970-01-01T00:00:00Z).

Returns:FileTime

a FileTime representing the time the file was last modified

Annotations
@Override
ownerback to summary
public UserPrincipal owner()

Implements java.nio.file.attribute.PosixFileAttributes.owner.

Doc from java.nio.file.attribute.PosixFileAttributes.owner.

Returns the owner of the file.

Returns:UserPrincipal

the file owner

Annotations
@Override
permissionsback to summary
public Set<PosixFilePermission> permissions()

Implements java.nio.file.attribute.PosixFileAttributes.permissions.

Doc from java.nio.file.attribute.PosixFileAttributes.permissions.

Returns the permissions of the file. The file permissions are returned as a set of PosixFilePermission elements. The returned set is a copy of the file permissions and is modifiable. This allows the result to be modified and passed to the setPermissions method to update the file's permissions.

Returns:Set<PosixFilePermission>

the file permissions

Annotations
@Override
sizeback to summary
public long size()

Implements java.nio.file.attribute.BasicFileAttributes.size.

Doc from java.nio.file.attribute.BasicFileAttributes.size.

Returns the size of the file (in bytes). The size may differ from the actual size on the file system due to compression, support for sparse files, or other reasons. The size of files that are not regular files is implementation specific and therefore unspecified.

Returns:long

the file size, in bytes

Annotations
@Override