- All Implemented Interfaces:
NfsFile<N,F>, Comparable<F>
- Direct Known Subclasses:
Nfs3File
-
Field Summary
Fields inherited from interface NfsFile
groupExecuteModeBit, groupReadModeBit, groupWriteModeBit, othersExecuteModeBit, othersReadModeBit, othersWriteModeBit, ownerExecuteModeBit, ownerReadModeBit, ownerWriteModeBit, saveSwappedTextModeBit, separator, separatorChar, setGroupIdOnExecuteModeBit, setUserIdOnExecuteModeBit -
Constructor Summary
ConstructorsConstructorDescriptionNfsFileBase(F parentFile, String childName) The most efficient constructor if the parent file already exists.NfsFileBase(N nfs, String path, LinkTracker<N, F> linkTracker) The basic constructor. -
Method Summary
Modifier and TypeMethodDescriptionaccess(long accessToCheck) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).booleanTests whether this client can delete an existing directory entry.booleanTests whether this client can execute this file (no meaning for a directory).booleanTests whether this client can write new data or add directory entries.booleanTests whether this client can look up a name in a directory (no meaning for non-directory objects).booleanTests whether this client can rewrite existing file data or modify existing directory entries.booleancanRead()Tests whether this client can read data from file or read a directory.commit(long offsetToCommit, int dataSizeToCommit) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).final intcreate(NfsCreateMode createMode, NfsSetAttributes attributes, byte[] verifier) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).booleanAtomically creates a new, empty file named by path if and only if a file with this name does not yet exist.voiddelete()Deletes this file/directory.final booleanbooleanexists()Tests whether this file exists on the NFS server.Resolves symbolic links while tracking link traversal.followLinks(LinkTracker<N, F> linkTracker) Resolves symbolic links while tracking link traversal.fsinfo()Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).fsstat()Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).final StringReturns the fully qualified path to the file in this network, including the server name and the exported folders, using the usual form:server:exported_folders/path_from_exported_filesystem_root.longgetAccess(long accessToCheck) Tests whether this client has the specified access permissions for this file.getattr()Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Returns the NFS attributes, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).getChildFile(String childName) Returns the child file.getChildFiles(List<String> childNames) Conversion method.byte[]Returns the NFS file handle, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).longReturns the number of unallocated bytes in the partition named by this abstract path name.longgetMode()Convenience method to access the protection mode bits, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813): 0x00800 - Set user ID on execution.final StringgetName()Returns the name.final NgetNfs()Returns the low-level NFS client supporting this NfsFile instance.final StringReturns the path of the parent folder, or null if there is none.Returns the NfsFile of the parent folder, or null if there is none.final StringgetPath()Returns the absolute path, from the root of the exported folders.longReturns the size of the partition named by this abstract pathname.longReturns the number of free bytes available to this client on the partition named by this abstract pathname.final inthashCode()booleanReturns true if it is, false if it is not.booleanisFile()Returns true if it is a normal file, false if it is not.booleanReturns true if it is the root file of the mount, false if it is not.longReturns time of last modification.longlength()Returns the length in bytes, or 0 if the file does not exist or the attributes cannot be read.longlengthEx()Returns the length in bytes.Makes the RPC call for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).list()Lists all files in this directory.list(NfsFilenameFilter filter) Lists all files matching the filter in this directory.Lists all files in this directory.listFiles(NfsFileFilter filter) Lists all files matching the filter in this directory.listFiles(NfsFilenameFilter filter) Lists all files matching the filter in this directory.lookup()Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeAccessRequest(long accessToCheck) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).static StringmakeChildPath(String parent, String child) Returns the full child path.makeCommitRequest(long offsetToCommit, int dataSizeToCommit) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeCreateRequest(NfsCreateMode createMode, NfsSetAttributes attributes, byte[] verifier) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeLinkRequest(F source) Convenience method for creating the request for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeMkdirRequest(NfsSetAttributes attributes) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeMknodRequest(NfsType type, NfsSetAttributes attributes, long[] rdev) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).static StringReturns everything after the last separator character.static StringmakeParentPath(String path) Returns everything up to and including the first separator character before the final name.Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeReaddirplusRequest(long cookie, long cookieverf, int dircount, int maxcount) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeReaddirRequest(long cookie, long cookieverf, int count) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeReadRequest(long offset, int size) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeRenameRequest(F toFile) Convenience method for creating the request for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeSetAttrRequest(NfsSetAttributes attributes, NfsTime guardTime) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeSymlinkRequest(String symbolicLinkData, NfsSetAttributes attributes) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeWriteRequest(long offset, List<ByteBuffer> payload, int syncType) Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).voidmkdir()Creates the directory if it does not exist.mkdir(NfsSetAttributes attributes) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).voidmkdirs()Creates the directory and all parent directories if they do not already exist.mknod(NfsType type, NfsSetAttributes attributes, long[] rdev) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).protected final FThis creates a new file with arbitrary path.protected abstract FnewFile(String path, LinkTracker<N, F> linkTracker) This creates a new file with arbitrary path, using the given LinkTracker.pathconf()Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).read(long offset, int size, byte[] bytes, int position) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).readdir(long cookie, long cookieverf, int count) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).readdir(long cookie, long cookieverf, int count, List<NfsDirectoryEntry> entries) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).readdirplus(long cookie, long cookieverf, int dircount, int maxcount) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).readdirplus(long cookie, long cookieverf, int dircount, int maxcount, List<NfsDirectoryPlusEntry> entries) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).readlink()Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).remove()Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Makes the RPC call for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).booleanRenames the file denoted by this abstract pathname.rmdir()Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).setattr(NfsSetAttributes attributes, NfsTime guardTime) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).voidsetAttributes(NfsSetAttributes nfsSetAttr) Sets NFS file attributes, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).protected final voidsetFileHandle(byte[] fileHandle) Sets the current NFS file handle.voidsetLastModified(long millis) Sets the last-modified time of the file or directory named by this abstract pathname.voidsetMode(long mode) Sets the protection mode bits, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).protected final voidsetPathFields(F toFile) Copies the path fields from another file.symlink(String symbolicLinkData, NfsSetAttributes attributes) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).final StringtoString()write(long offset, List<ByteBuffer> payload, int syncType) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).write(long offset, List<ByteBuffer> payload, int syncType, Long verifier) Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Methods inherited from interface NfsFile
newChildFile
-
Constructor Details
-
NfsFileBase
The basic constructor.- Parameters:
nfs- The supporting NFS client.path- The full path of the file, starting with the mount point.linkTracker- The tracker to use. This must be passed so that monitoring is continued until the link resolves to a file that is not a symbolic link.- Throws:
IOException
-
NfsFileBase
The most efficient constructor if the parent file already exists.- Parameters:
parentFile- The parent file, stored to reduce lookup overheadchildName- The short name of the file, starting from the parent path.- Throws:
IOException
-
-
Method Details
-
makeParentPath
-
makeName
-
makeChildPath
-
canDelete
Tests whether this client can delete an existing directory entry. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). -
canExecute
Tests whether this client can execute this file (no meaning for a directory). Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).- Specified by:
canExecutein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
trueif it can,falseif it cannot- Throws:
IOException- if it does not exist or permissions cannot be read.
-
canExtend
Tests whether this client can write new data or add directory entries. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). -
canLookup
Tests whether this client can look up a name in a directory (no meaning for non-directory objects). Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). -
canModify
Tests whether this client can rewrite existing file data or modify existing directory entries. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). -
canRead
Tests whether this client can read data from file or read a directory. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). -
compareTo
-
createNewFile
Atomically creates a new, empty file named by path if and only if a file with this name does not yet exist. The test for the existence of the file and the creation of the file if it does not exist are a single operation that is atomic with respect to all other filesystem activities that might affect the file.- Specified by:
createNewFilein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
trueif the named file did not exist and was successfully created;falseif the named file already existed.- Throws:
IOException- If an I/O error occurred
-
delete
-
equals
-
exists
-
followLinks
Resolves symbolic links while tracking link traversal.- Specified by:
followLinksin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- The backing file obtained by following all symbolic links in the path, if any.
- Throws:
IOException
-
followLinks
Resolves symbolic links while tracking link traversal.- Specified by:
followLinksin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
linkTracker- The tracker to use. This must be passed so that monitoring is continued until the link resolves to a file that is not a symbolic link.- Returns:
- The backing file obtained by following all symbolic links in the path, if any.
- Throws:
IOException
-
getAbsolutePath
Returns the fully qualified path to the file in this network, including the server name and the exported folders, using the usual form:server:exported_folders/path_from_exported_filesystem_root. -
getAccess
Tests whether this client has the specified access permissions for this file. The bits for the request and reply are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813):ACCESS3_READ = 0x0001 - Read data from file or read a directory. ACCESS3_LOOKUP = 0x0002 - Look up a name in a directory (no meaning for non-directory objects). ACCESS3_MODIFY = 0x0004 - Rewrite existing file data or modify existing directory entries. ACCESS3_EXTEND = 0x0008 - Write new data or add directory entries. ACCESS3_DELETE = 0x0010 - Delete an existing directory entry. ACCESS3_EXECUTE = 0x0020 - Execute file (no meaning for a directory).
In general, it is not sufficient for the client to attempt to deduce access permissions by inspecting the uid, gid, and mode fields in the file attributes, since the server may perform uid or gid mapping or enforce additional access control restrictions. It is also possible that the NFS version 3 protocol server may not be in the same ID space as the NFS version 3 protocol client. In these cases (and perhaps others), the NFS version 3 protocol client can not reliably perform an access check with only current file attributes.In the NFS version 2 protocol, the only reliable way to determine whether an operation was allowed was to try it and see if it succeeded or failed. Using the ACCESS procedure in the NFS version 3 protocol, the client can ask the server to indicate whether or not one or more classes of operations are permitted. The ACCESS operation is provided to allow clients to check before doing a series of operations. This is useful in operating systems (such as UNIX) where permission checking is done only when a file or directory is opened. This procedure is also invoked by NFS client access procedure (called possibly through access(2)). The intent is to make the behavior of opening a remote file more consistent with the behavior of opening a local file.
- Specified by:
getAccessin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
accessToCheck- A bit mask of access permissions to check, as specified below.ACCESS3_READ = 0x0001 - Read data from file or read a directory. ACCESS3_LOOKUP = 0x0002 - Look up a name in a directory (no meaning for non-directory objects). ACCESS3_MODIFY = 0x0004 - Rewrite existing file data or modify existing directory entries. ACCESS3_EXTEND = 0x0008 - Write new data or add directory entries. ACCESS3_DELETE = 0x0010 - Delete an existing directory entry. ACCESS3_EXECUTE = 0x0020 - Execute file (no meaning for a directory).- Returns:
- The access bitmap, as specified below.
ACCESS3_READ = 0x0001 - Read data from file or read a directory. ACCESS3_LOOKUP = 0x0002 - Look up a name in a directory (no meaning for non-directory objects). ACCESS3_MODIFY = 0x0004 - Rewrite existing file data or modify existing directory entries. ACCESS3_EXTEND = 0x0008 - Write new data or add directory entries. ACCESS3_DELETE = 0x0010 - Delete an existing directory entry. ACCESS3_EXECUTE = 0x0020 - Execute file (no meaning for a directory). - Throws:
IOException- if it does not exist or permissions cannot be read.
-
getAttributes
Returns the NFS attributes, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).- Specified by:
getAttributesin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- The NFS attributes, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
- Throws:
IOException
-
getChildFile
Returns the child file.- Specified by:
getChildFilein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- The child file.
- Throws:
IOException
-
getFileHandle
Returns the NFS file handle, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).- Specified by:
getFileHandlein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- The NFS file handle, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
- Throws:
IOException
-
getFreeSpace
Returns the number of unallocated bytes in the partition named by this abstract path name.- Specified by:
getFreeSpacein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- The number of unallocated bytes in the partition named by this abstract path name.
- Throws:
IOException
-
getMode
Convenience method to access 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.
-
getName
-
getNfs
-
getParent
-
getParentFile
-
getPath
-
getTotalSpace
Returns the size of the partition named by this abstract pathname.- Specified by:
getTotalSpacein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- The size of the partition named by this abstract pathname.
- Throws:
IOException
-
getUsableSpace
Returns the number of free bytes available to this client on the partition named by this abstract pathname.- Specified by:
getUsableSpacein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- The number of free bytes available to this client on the partition named by this abstract pathname.
- Throws:
IOException
-
hashCode
-
isDirectory
Returns true if it is, false if it is not.- Specified by:
isDirectoryin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- true if it is, false if it is not
- Throws:
IOException
-
isFile
-
isRootFile
Returns true if it is the root file of the mount, false if it is not.- Specified by:
isRootFilein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- true if it is the root file of the mount, false if it is not
- Throws:
IOException
-
lastModified
Returns time of last modification.- Specified by:
lastModifiedin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- time of last modification
- Throws:
IOException
-
length
-
lengthEx
-
list
Lists all files in this directory.Preserves the server's entry order across READDIR responses, excluding
.and... The client does not request sorting or sort the results. NFSv3 does not guarantee alphabetical order or the same order across listings or servers. Sort the complete returned list if a specific order is required. A listing is not a snapshot of a changing directory. -
list
Lists all files matching the filter in this directory.Preserves the relative server order of accepted entries. The ordering and consistency considerations described in
NfsFile.list()apply. -
listFiles
Lists all files in this directory.Returns file objects in the order produced by
NfsFile.list(), without sorting. The ordering and consistency considerations described there apply. -
listFiles
Lists all files matching the filter in this directory.Preserves the relative server order of accepted entries. The ordering and consistency considerations described in
NfsFile.list()apply. -
listFiles
Lists all files matching the filter in this directory.Preserves the relative server order of accepted entries. The ordering and consistency considerations described in
NfsFile.list()apply. -
mkdir
-
mkdirs
-
renameTo
Renames the file denoted by this abstract pathname.Many aspects of the behavior of this method are inherently platform-dependent: The rename operation might not be able to move a file from one filesystem to another, it might not be atomic, and it might not succeed if a file with the destination abstract pathname already exists. The return value should always be checked to make sure that the rename operation was successful.
-
setLastModified
Sets the last-modified time of the file or directory named by this abstract pathname.All platforms support file-modification times to the nearest second, but some provide more precision. The argument will be truncated to fit the supported precision. If the operation succeeds and no intervening operations on the file take place, then the next invocation of the lastModified() method will return the (possibly truncated) time argument that was passed to this method.
- Specified by:
setLastModifiedin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
millis- - The new last-modified time, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970)- Throws:
IOException
-
toString
-
setAttributes
Sets NFS file attributes, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).- Specified by:
setAttributesin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Throws:
IOException
-
setMode
Sets the protection mode bits, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This replaces thejava.io.FilemethodssetExecutable,setReadable, andsetWritable. The protection mode bits are defined as follows:- 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.
-
getattr
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure GETATTR retrieves the attributes for a specified file system object. The object is identified by the file handle that the server returned as part of the response from a LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD, or READDIRPLUS procedure (or from the MOUNT service, described elsewhere).
-
makeGetAttrRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure GETATTR retrieves the attributes for a specified file system object. The object is identified by the file handle that the server returned as part of the response from a LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD, or READDIRPLUS procedure (or from the MOUNT service, described elsewhere).
- Specified by:
makeGetAttrRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- the request
- Throws:
IOException
-
setattr
public NfsSetAttrResponse setattr(NfsSetAttributes attributes, NfsTime guardTime) throws IOException Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure SETATTR changes one or more of the attributes of a file system object on the server.
- Specified by:
setattrin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
attributes- The attributes to set.guardTime- IfguardTimeis not null, the server must compare the value ofguardTimeto the current ctime of the object. If the values are different, the server must preserve the object attributes and must return a status of NFS3ERR_NOT_SYNC.- Returns:
- the response
- Throws:
IOException
-
makeSetAttrRequest
public NfsSetAttrRequest makeSetAttrRequest(NfsSetAttributes attributes, NfsTime guardTime) throws IOException Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure SETATTR changes one or more of the attributes of a file system object on the server.
- Specified by:
makeSetAttrRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
attributes- The attributes to set.guardTime- IfguardTimeis not null, the server must compare the value ofguardTimeto the current ctime of the object. If the values are different, the server must preserve the object attributes and must return a status of NFS3ERR_NOT_SYNC.- Returns:
- the request
- Throws:
IOException
-
lookup
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure LOOKUP searches a directory for a specific name and returns the file handle for the corresponding file system object.
-
makeLookupRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure LOOKUP searches a directory for a specific name and returns the file handle for the corresponding file system object.
- Specified by:
makeLookupRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- the request
- Throws:
IOException
-
access
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure ACCESS determines the access rights that a user, as identified by the credentials in the request, has with respect to a file system object. The client encodes the set of permissions that are to be checked in a bit mask. The server checks the permissions encoded in the bit mask. A status of NFS3_OK is returned along with a bit mask encoded with the permissions that the client is allowed.
The results of this procedure are necessarily advisory in nature. That is, a return status of NFS3_OK and the appropriate bit set in the bit mask does not imply that such access will be allowed to the file system object in the future, as access rights can be revoked by the server at any time.
- Specified by:
accessin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
accessToCheck- A bit mask of access permissions to check, as specified below.ACCESS3_READ = 0x0001 - Read data from file or read a directory. ACCESS3_LOOKUP = 0x0002 - Look up a name in a directory (no meaning for non-directory objects). ACCESS3_MODIFY = 0x0004 - Rewrite existing file data or modify existing directory entries. ACCESS3_EXTEND = 0x0008 - Write new data or add directory entries. ACCESS3_DELETE = 0x0010 - Delete an existing directory entry. ACCESS3_EXECUTE = 0x0020 - Execute file (no meaning for a directory).- Returns:
- the response
- Throws:
IOException
-
makeAccessRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure ACCESS determines the access rights that a user, as identified by the credentials in the request, has with respect to a file system object. The client encodes the set of permissions that are to be checked in a bit mask. The server checks the permissions encoded in the bit mask. A status of NFS3_OK is returned along with a bit mask encoded with the permissions that the client is allowed.
The results of this procedure are necessarily advisory in nature. That is, a return status of NFS3_OK and the appropriate bit set in the bit mask does not imply that such access will be allowed to the file system object in the future, as access rights can be revoked by the server at any time.
- Specified by:
makeAccessRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
accessToCheck- A bit mask of access permissions to check, as specified below.ACCESS3_READ = 0x0001 - Read data from file or read a directory. ACCESS3_LOOKUP = 0x0002 - Look up a name in a directory (no meaning for non-directory objects). ACCESS3_MODIFY = 0x0004 - Rewrite existing file data or modify existing directory entries. ACCESS3_EXTEND = 0x0008 - Write new data or add directory entries. ACCESS3_DELETE = 0x0010 - Delete an existing directory entry. ACCESS3_EXECUTE = 0x0020 - Execute file (no meaning for a directory).- Returns:
- the request
- Throws:
IOException
-
readlink
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.This method reads the data associated with a symbolic link. The data is an ASCII string that is opaque to the server. That is, whether created by the NFS version 3 protocol software from a client or created locally on the server, the data in a symbolic link is not interpreted when created, but is simply stored.
A symbolic link is nominally a pointer to another file. The data is not necessarily interpreted by the server, just stored in the file. It is possible for a client implementation to store a path name that is not meaningful to the server operating system in a symbolic link. A READLINK operation returns the data to the client for interpretation. If different implementations want to share access to symbolic links, then they must agree on the interpretation of the data in the symbolic link.
-
makeReadlinkRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).This method reads the data associated with a symbolic link. The data is an ASCII string that is opaque to the server. That is, whether created by the NFS version 3 protocol software from a client or created locally on the server, the data in a symbolic link is not interpreted when created, but is simply stored.
A symbolic link is nominally a pointer to another file. The data is not necessarily interpreted by the server, just stored in the file. It is possible for a client implementation to store a path name that is not meaningful to the server operating system in a symbolic link. A READLINK operation returns the data to the client for interpretation. If different implementations want to share access to symbolic links, then they must agree on the interpretation of the data in the symbolic link.
- Specified by:
makeReadlinkRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- the request
- Throws:
IOException
-
read
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure READ reads data from a file.
- Specified by:
readin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
offset- The position within the file at which the read is to begin. Anoffsetof 0 means to read data starting at the beginning of the file. Ifoffsetis greater than or equal to the size of the file, the status, NFS3_OK, is returned withsizeset to 0 andeofset totrue, subject to access permissions checking.size- The number of bytes of data that are to be read. Ifsizeis 0, the READ will succeed and return 0 bytes of data, subject to access permissions checking.sizemust be less than or equal to the value of thertmaxfield in the FSINFO reply structure for the file system that contains file. If greater, the server may return onlyrtmaxbytes, resulting in a short read.bytes- optional externally provided buffer - if not provided, the method will create a new, empty buffer for receiving the data.position- position to start writing, defaults to 0 if buffer is null- Returns:
- the response
- Throws:
IOException
-
makeReadRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure READ reads data from a file.
- Specified by:
makeReadRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
offset- The position within the file at which the read is to begin. Anoffsetof 0 means to read data starting at the beginning of the file. Ifoffsetis greater than or equal to the size of the file, the status, NFS3_OK, is returned withsizeset to 0 andeofset totrue, subject to access permissions checking.size- The number of bytes of data that are to be read. Ifsizeis 0, the READ will succeed and return 0 bytes of data, subject to access permissions checking.sizemust be less than or equal to the value of thertmaxfield in the FSINFO reply structure for the file system that contains file. If greater, the server may return onlyrtmaxbytes, resulting in a short read.- Returns:
- the request
- Throws:
IOException
-
write
public NfsWriteResponse write(long offset, List<ByteBuffer> payload, int syncType) throws IOException Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure WRITE writes data to a file.
- Specified by:
writein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
offset- The position within the file at which the write is to begin. An offset of 0 means to write data starting at the beginning of the file.payload- The data to be written to the file.syncType- One of the values below.UNSTABLE = 0 - Best effort, no promises. DATA_SYNC = 1 - Commit all data to stable storage, plus enough metadata for retrieval, before returning. FILE_SYNC = 2 - Commit all data and metadata to stable storage before returning.- Returns:
- the response
- Throws:
IOException
-
write
public NfsWriteResponse write(long offset, List<ByteBuffer> payload, int syncType, Long verifier) throws IOException Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure WRITE writes data to a file.
- Specified by:
writein interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
offset- The position within the file at which the write is to begin. An offset of 0 means to write data starting at the beginning of the file.payload- The data to be written to the file.syncType- One of the values below.- UNSTABLE = 0 - Best effort, no promises.
- DATA_SYNC = 1 - Commit all data to stable storage, plus enough metadata for retrieval, before returning.
- FILE_SYNC = 2 - Commit all data and metadata to stable storage before returning.
verifier- This is a cookie, previously returned from the server, that the client can use to determine whether the server has changed state between a call to WRITE and a subsequent call to either WRITE or COMMIT.- Returns:
- the response
- Throws:
IOException
-
makeWriteRequest
public NfsWriteRequest makeWriteRequest(long offset, List<ByteBuffer> payload, int syncType) throws IOException Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure WRITE writes data to a file.
- Specified by:
makeWriteRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
offset- The position within the file at which the write is to begin. An offset of 0 means to write data starting at the beginning of the file.payload- The data to be written to the file.syncType- One of the values below.- UNSTABLE = 0 - Best effort, no promises.
- DATA_SYNC = 1 - Commit all data to stable storage, plus enough metadata for retrieval, before returning.
- FILE_SYNC = 2 - Commit all data and metadata to stable storage before returning.
- Returns:
- the request
- Throws:
IOException
-
create
public NfsCreateResponse create(NfsCreateMode createMode, NfsSetAttributes attributes, byte[] verifier) throws IOException Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure CREATE creates a regular file.
- Specified by:
createin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
createMode- The instance describing how the file is to be created. UNCHECKED means that the file should be created without checking for the existence of a duplicate file in the same directory. In this case, how.obj_attributes is a sattr3 describing the initial attributes for the file. GUARDED specifies that the server should check for the presence of a duplicate file before performing the create and should fail the request with NFS3ERR_EXIST if a duplicate file exists. If the file does not exist, the request is performed as described for UNCHECKED. EXCLUSIVE specifies that the server is to follow exclusive creation semantics, using the verifier to ensure exclusive creation of the target. No attributes may be provided in this case, since the server may use the target file metadata to store the createverf3 verifier.attributes- The initial attributes for the new file.verifier- A unique identifier to ensure exclusive creation of the new file. If no value is provided for exclusive creation, this is generated.- Returns:
- the response
- Throws:
IOException
-
makeCreateRequest
public NfsCreateRequest makeCreateRequest(NfsCreateMode createMode, NfsSetAttributes attributes, byte[] verifier) throws IOException Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure CREATE creates a regular file.
- Specified by:
makeCreateRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
createMode- The instance describing how the file is to be created. UNCHECKED means that the file should be created without checking for the existence of a duplicate file in the same directory. In this case, how.obj_attributes is a sattr3 describing the initial attributes for the file. GUARDED specifies that the server should check for the presence of a duplicate file before performing the create and should fail the request with NFS3ERR_EXIST if a duplicate file exists. If the file does not exist, the request is performed as described for UNCHECKED. EXCLUSIVE specifies that the server is to follow exclusive creation semantics, using the verifier to ensure exclusive creation of the target. No attributes may be provided in this case, since the server may use the target file metadata to store the createverf3 verifier.attributes- The initial attributes for the new file.verifier- A unique identifier to ensure exclusive creation of the new file. If no value is provided for exclusive creation, this is generated.- Returns:
- the request
- Throws:
IOException
-
mkdir
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure MKDIR creates a new subdirectory.
-
makeMkdirRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure MKDIR creates a new subdirectory.
- Specified by:
makeMkdirRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
attributes- The initial attributes for the subdirectory.- Returns:
- the request
- Throws:
IOException
-
symlink
public NfsSymlinkResponse symlink(String symbolicLinkData, NfsSetAttributes attributes) throws IOException Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure SYMLINK creates a new symbolic link.
-
makeSymlinkRequest
public NfsSymlinkRequest makeSymlinkRequest(String symbolicLinkData, NfsSetAttributes attributes) throws IOException Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure SYMLINK creates a new symbolic link.
- Specified by:
makeSymlinkRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
symbolicLinkData- The string containing the symbolic link data.attributes- The initial attributes for the symbolic link.- Returns:
- the request
- Throws:
IOException
-
mknod
public NfsMknodResponse mknod(NfsType type, NfsSetAttributes attributes, long[] rdev) throws IOException Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure MKNOD creates a new special file of the type,
type. Special files can be device files or named pipes.- Specified by:
mknodin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
type- The type of the object to be created.attributes- The initial attributes for the special file.rdev- When creating a character special file (typeisNF3CHR) or a block special file (typeisNF3BLK),rdev[0]is the major number andrdev[1]is the minor number.- Returns:
- the response
- Throws:
IOException
-
makeMknodRequest
public NfsMknodRequest makeMknodRequest(NfsType type, NfsSetAttributes attributes, long[] rdev) throws IOException Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure MKNOD creates a new special file of the type,
type. Special files can be device files or named pipes.- Specified by:
makeMknodRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
type- The type of the object to be created.attributes- The initial attributes for the special file.rdev- When creating a character special file (typeisNF3CHR) or a block special file (typeisNF3BLK),rdev[0]is the major number andrdev[1]is the minor number.- Returns:
- the request
- Throws:
IOException
-
remove
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure REMOVE removes (deletes) an entry from a directory. If the entry in the directory was the last reference to the corresponding file system object, the object may be destroyed.
-
makeRemoveRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure REMOVE removes (deletes) an entry from a directory. If the entry in the directory was the last reference to the corresponding file system object, the object may be destroyed.
- Specified by:
makeRemoveRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- the request
- Throws:
IOException
-
rmdir
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure RMDIR removes (deletes) a subdirectory from a directory. If the directory entry of the subdirectory is the last reference to the subdirectory, the subdirectory may be destroyed.
-
makeRmdirRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure RMDIR removes (deletes) a subdirectory from a directory. If the directory entry of the subdirectory is the last reference to the subdirectory, the subdirectory may be destroyed.
- Specified by:
makeRmdirRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- the request
- Throws:
IOException
-
rename
Makes the RPC call for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure RENAME changes the path of this file to the path specified by
toFile. The operation is required to be atomic to the client. This file andtoFilemust reside on the same file system and server. -
makeRenameRequest
Convenience method for creating the request for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure RENAME changes the path of this file to the path specified by
toFile. The operation is required to be atomic to the client. This file andtoFilemust reside on the same file system and server.- Specified by:
makeRenameRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
toFile- A file object with the new path for this object.- Returns:
- the request
- Throws:
IOException
-
link
Makes the RPC call for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure LINK creates a hard link from
sourceto this file. This file andsourcemust reside on the same file system and server. -
makeLinkRequest
Convenience method for creating the request for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure LINK creates a hard link from
sourceto this file. This file andsourcemust reside on the same file system and server.- Specified by:
makeLinkRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
source- The existing file system object to which this file should be linked.- Returns:
- the request
- Throws:
IOException
-
readdir
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure READDIR retrieves a variable number of entries, in sequence, from a directory and returns the name and file identifier for each, with information to allow the client to request additional directory entries in a subsequent READDIR request.
- Specified by:
readdirin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
cookie- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieas returned by the server.cookieverf- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieverfas returned by the server. Thecookieverfmust match that returned by the READDIR in which thecookiewas acquired.count- The maximum size of the READDIR3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less than count bytes of data.- Returns:
- the response
- Throws:
IOException
-
readdir
public NfsReaddirResponse readdir(long cookie, long cookieverf, int count, List<NfsDirectoryEntry> entries) throws IOException Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure READDIR retrieves a variable number of entries, in sequence, from a directory and returns the name and file identifier for each, with information to allow the client to request additional directory entries in a subsequent READDIR request.
- Specified by:
readdirin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
cookie- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieas returned by the server.cookieverf- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieverfas returned by the server. Thecookieverfmust match that returned by the READDIR in which thecookiewas acquired.count- The maximum size of the READDIR3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less than count bytes of data.entries- A list to which the incoming data should be appended.- Returns:
- the response
- Throws:
IOException
-
makeReaddirRequest
public NfsReaddirRequest makeReaddirRequest(long cookie, long cookieverf, int count) throws IOException Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure READDIR retrieves a variable number of entries, in sequence, from a directory and returns the name and file identifier for each, with information to allow the client to request additional directory entries in a subsequent READDIR request.
- Specified by:
makeReaddirRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
cookie- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieas returned by the server.cookieverf- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieverfas returned by the server. Thecookieverfmust match that returned by the READDIR in which thecookiewas acquired.count- The maximum size of the READDIR3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less than count bytes of data.- Returns:
- the request
- Throws:
IOException
-
readdirplus
public NfsReaddirplusResponse readdirplus(long cookie, long cookieverf, int dircount, int maxcount) throws IOException Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure READDIRPLUS retrieves a variable number of entries from a file system directory and returns complete information about each along with information to allow the client to request additional directory entries in a subsequent READDIRPLUS. READDIRPLUS differs from READDIR only in the amount of information returned for each entry. In READDIR, each entry returns the filename and the fileid. In READDIRPLUS, each entry returns the name, the fileid, attributes (including the fileid), and file handle.
- Specified by:
readdirplusin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
cookie- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieas returned by the server.cookieverf- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieverfas returned by the server. Thecookieverfmust match that returned by the READDIRPLUS in which thecookiewas acquired.dircount- The maximum number of bytes of directory information returned. This number should not include the size of the attributes and file handle portions of the result.maxcount- The maximum size of the READDIRPLUS3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less thanmaxcountbytes of data.- Returns:
- the response
- Throws:
IOException
-
readdirplus
public NfsReaddirplusResponse readdirplus(long cookie, long cookieverf, int dircount, int maxcount, List<NfsDirectoryPlusEntry> entries) throws IOException Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure READDIRPLUS retrieves a variable number of entries from a file system directory and returns complete information about each along with information to allow the client to request additional directory entries in a subsequent READDIRPLUS. READDIRPLUS differs from READDIR only in the amount of information returned for each entry. In READDIR, each entry returns the filename and the fileid. In READDIRPLUS, each entry returns the name, the fileid, attributes (including the fileid), and file handle.
- Specified by:
readdirplusin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
cookie- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieas returned by the server.cookieverf- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieverfas returned by the server. Thecookieverfmust match that returned by the READDIRPLUS in which thecookiewas acquired.dircount- The maximum number of bytes of directory information returned. This number should not include the size of the attributes and file handle portions of the result.maxcount- The maximum size of the READDIRPLUS3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less thanmaxcountbytes of data.entries- A list to which the incoming data should be appended.- Returns:
- the response
- Throws:
IOException
-
makeReaddirplusRequest
public NfsReaddirplusRequest makeReaddirplusRequest(long cookie, long cookieverf, int dircount, int maxcount) throws IOException Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure READDIRPLUS retrieves a variable number of entries from a file system directory and returns complete information about each along with information to allow the client to request additional directory entries in a subsequent READDIRPLUS. READDIRPLUS differs from READDIR only in the amount of information returned for each entry. In READDIR, each entry returns the filename and the fileid. In READDIRPLUS, each entry returns the name, the fileid, attributes (including the fileid), and file handle.
- Specified by:
makeReaddirplusRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
cookie- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieas returned by the server.cookieverf- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieverfas returned by the server. Thecookieverfmust match that returned by the READDIRPLUS in which thecookiewas acquired.dircount- The maximum number of bytes of directory information returned. This number should not include the size of the attributes and file handle portions of the result.maxcount- The maximum size of the READDIRPLUS3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less thanmaxcountbytes of data.- Returns:
- the request
- Throws:
IOException
-
fsstat
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure FSSTAT retrieves volatile file system state information.
-
makeFsStatRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure FSSTAT retrieves volatile file system state information.
- Specified by:
makeFsStatRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- the request
- Throws:
IOException
-
fsinfo
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation.
-
makeFsInfoRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation.
- Specified by:
makeFsInfoRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- the request
- Throws:
IOException
-
pathconf
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure PATHCONF retrieves the pathconf information for a file or directory. If the FSF_HOMOGENEOUS bit is set in FSFINFO3resok.properties, the pathconf information will be the same for all files and directories in the exported file system in which this file or directory resides.
-
makePathconfRequest
Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure PATHCONF retrieves the pathconf information for a file or directory. If the FSF_HOMOGENEOUS bit is set in FSFINFO3resok.properties, the pathconf information will be the same for all files and directories in the exported file system in which this file or directory resides.
- Specified by:
makePathconfRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Returns:
- the request
- Throws:
IOException
-
commit
Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This call is wrapped as provided by the Nfs client to include repeated attempts, error checking, and logging.Procedure COMMIT forces or flushes data to stable storage that was previously written with a WRITE procedure call with the stable field set to UNSTABLE.
- Specified by:
commitin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
offsetToCommit- The position within the file at which the flush is to begin. An offset of 0 means to flush data starting at the beginning of the file.dataSizeToCommit- The number of bytes of data to flush. If count is 0, a flush from offset to the end of file is done.- Returns:
- the response
- Throws:
IOException
-
makeCommitRequest
public NfsCommitRequest makeCommitRequest(long offsetToCommit, int dataSizeToCommit) throws IOException Convenience method for creating the request for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure COMMIT forces or flushes data to stable storage that was previously written with a WRITE procedure call with the stable field set to UNSTABLE.
- Specified by:
makeCommitRequestin interfaceNfsFile<N extends Nfs<F>, F extends NfsFile<N,F>> - Parameters:
offsetToCommit- The position within the file at which the flush is to begin. An offset of 0 means to flush data starting at the beginning of the file.dataSizeToCommit- The number of bytes of data to flush. If count is 0, a flush from offset to the end of file is done.- Returns:
- the request
- Throws:
IOException
-
getChildFiles
Conversion method.- Parameters:
childNames- A list of child names.- Returns:
- The list of child files, one for each name.
- Throws:
IOException
-
setFileHandle
protected final void setFileHandle(byte[] fileHandle) Sets the current NFS file handle. -
newFile
This creates a new file with arbitrary path.- Parameters:
path- the absolute path from the mount point.- Returns:
- the new nfs file.
- Throws:
IOException
-
newFile
This creates a new file with arbitrary path, using the given LinkTracker.- Parameters:
path- the absolute path from the mount point.linkTracker- The tracker to use. This must be passed so that monitoring is continued until the link resolves to a file that is not a symbolic link.- Returns:
- A new file corresponding to the path, created using the linkTracker
- Throws:
IOException
-
setPathFields
Copies the path fields from another file.
-