Class NfsGetAttributes
java.lang.Object
com.emc.ecs.nfsclient.nfs.NfsGetAttributes
Holder for returned file system object attributes, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAtime()Returns the time when the file data was last accessed.getCtime()Returns the time when the attributes of the file were last changed.longReturns a number which uniquely identifies the file within its file system (on UNIX this would be the inumber).longgetFsid()Returns the file system identifier for the file system.longgetGid()Returns the group ID of the group of the file.longgetMode()Returns the protection mode bits, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813): 0x00800 - Set user ID on execution.getMtime()Returns the time when the file data was last modified.longgetNlink()Returns the number of hard links to the file - that is, the number of different names for the same file.long[]getRdev()Returns a description of the device file if the file type is NF3CHR or NF3BLK.The interpretation of rdev depends on the type of file system object.longgetSize()Returns the size of the file in bytes.getType()Returns the ftype3 enum of the file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).longgetUid()Returns the user ID of the owner of the file.longgetUsed()Returns the number of bytes of disk space that the file actually uses (which can be smaller than the size because the file may have holes or it may be larger due to fragmentation).booleanisLoaded()Returnstrueif the properties have been loaded from NFS server data,falseotherwise.toString()voidunmarshalling(Xdr xdr) Reads the Xdr response, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
-
Constructor Details
-
NfsGetAttributes
public NfsGetAttributes()
-
-
Method Details
-
unmarshalling
Reads the Xdr response, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). -
isLoaded
public boolean isLoaded()Returnstrueif the properties have been loaded from NFS server data,falseotherwise. -
getType
Returns the ftype3 enum of the file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
enum ftype3 { NF3REG = 1, NF3DIR = 2, NF3BLK = 3, NF3CHR = 4, NF3LNK = 5, NF3SOCK = 6, NF3FIFO = 7 };The enumeration, ftype3, gives the type of a file. The type, NF3REG, is a regular file, NF3DIR is a directory, NF3BLK is a block special device file, NF3CHR is a character special device file, NF3LNK is a symbolic link, NF3SOCK is a socket, and NF3FIFO is a named pipe. Note that the precise enum encoding must be followed. -
getMode
public long getMode()Returns the protection mode bits, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813):- 0x00800 - Set user ID on execution.
- 0x00400 - Set group ID on execution.
- 0x00200 - Save swapped text (not defined in POSIX).
- 0x00100 - Read permission for owner.
- 0x00080 - Write permission for owner.
- 0x00040 - Execute permission for owner on a file. Or lookup (search) permission for owner in directory.
- 0x00020 - Read permission for group.
- 0x00010 - Write permission for group.
- 0x00008 - Execute permission for group on a file. Or lookup (search) permission for group in directory.
- 0x00004 - Read permission for others.
- 0x00002 - Write permission for others.
- 0x00001 - Execute permission for others on a file. Or lookup (search) permission for others in directory.
-
getNlink
public long getNlink()Returns the number of hard links to the file - that is, the number of different names for the same file. -
getUid
public long getUid()Returns the user ID of the owner of the file. -
getGid
public long getGid()Returns the group ID of the group of the file. -
getSize
public long getSize()Returns the size of the file in bytes. -
getUsed
public long getUsed()Returns the number of bytes of disk space that the file actually uses (which can be smaller than the size because the file may have holes or it may be larger due to fragmentation). -
getRdev
public long[] getRdev()Returns a description of the device file if the file type is NF3CHR or NF3BLK.The interpretation of rdev depends on the type of file system object. For a block special (NF3BLK) or character special (NF3CHR) file, rdev[0] and rdev[1] are the major and minor device numbers, respectively. (This is obviously a UNIX-specific interpretation.) For all other file types, these two elements should either be set to 0 or the values should be agreed upon by the client and server. If the client and server do not agree upon the values, the client should treat these fields as if they are set to 0. This data field is returned as part of the fattr3 structure and so is available from all replies returning attributes. Since these fields are otherwise unused for objects which are not devices, out of band information can be passed from the server to the client. However, once again, both the server and the client must agree on the values passed. -
getFsid
public long getFsid()Returns the file system identifier for the file system. -
getFileid
public long getFileid()Returns a number which uniquely identifies the file within its file system (on UNIX this would be the inumber). -
getAtime
Returns the time when the file data was last accessed. -
getMtime
Returns the time when the file data was last modified. -
getCtime
Returns the time when the attributes of the file were last changed. Writing to the file changes the ctime in addition to the mtime. -
toString
-