Interface Nfs<F extends NfsFile<?,?>>

All Known Implementing Classes:
Nfs3

public interface Nfs<F extends NfsFile<?,?>>
Client for an NFS RPC server, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
  • Field Details

    • RPC_PROGRAM

      static final int RPC_PROGRAM
      Program number for Nfs calls
      See Also:
    • MOUNTPROG

      static final int MOUNTPROG
      Program number for Mount calls
      See Also:
    • NFSPROC3_NULL

      static final int NFSPROC3_NULL
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_GETATTR

      static final int NFSPROC3_GETATTR
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_SETATTR

      static final int NFSPROC3_SETATTR
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_LOOKUP

      static final int NFSPROC3_LOOKUP
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_ACCESS

      static final int NFSPROC3_ACCESS
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_READ

      static final int NFSPROC3_READ
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_WRITE

      static final int NFSPROC3_WRITE
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_CREATE

      static final int NFSPROC3_CREATE
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_MKDIR

      static final int NFSPROC3_MKDIR
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_MKNOD

      static final int NFSPROC3_MKNOD
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_REMOVE

      static final int NFSPROC3_REMOVE
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_RMDIR

      static final int NFSPROC3_RMDIR
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_RENAME

      static final int NFSPROC3_RENAME
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_READDIR

      static final int NFSPROC3_READDIR
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_READDIRPLUS

      static final int NFSPROC3_READDIRPLUS
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_FSSTAT

      static final int NFSPROC3_FSSTAT
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_FSINFO

      static final int NFSPROC3_FSINFO
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_PATHCONF

      static final int NFSPROC3_PATHCONF
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • NFSPROC3_COMMIT

      static final int NFSPROC3_COMMIT
      NFS version 3 procedure number. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • ACCESS3_READ

      static final long ACCESS3_READ
      Read data from file or read a directory. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • ACCESS3_LOOKUP

      static final long ACCESS3_LOOKUP
      Look up a name in a directory (no meaning for non-directory objects). Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • ACCESS3_MODIFY

      static final long ACCESS3_MODIFY
      Rewrite existing file data or modify existing directory entries. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • ACCESS3_EXTEND

      static final long ACCESS3_EXTEND
      Write new data or add directory entries. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • ACCESS3_DELETE

      static final long ACCESS3_DELETE
      Delete an existing directory entry. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • ACCESS3_EXECUTE

      static final long ACCESS3_EXECUTE
      Execute file (no meaning for a directory). Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
  • Method Details

    • disableSudo

      void disableSudo() throws IOException
      Return to the default Credential.
      Throws:
      IOException
    • enableSudo

      void enableSudo(int uid, int gid)
      Use a custom Credential.
      Parameters:
      uid - Unix uid
      gid - Unix gid
    • getCredential

      Credential getCredential()
      Returns the Credential used for RPC calls.
    • getExportedPath

      String getExportedPath()
      Returns the path on the filesystem that is exported by the NFS server.
    • getRootFileHandle

      byte[] getRootFileHandle()
      Returns the root file handle of the exported filesystem, for debugging and naked API calls.
    • getPort

      int getPort()
      Returns the TCP destination port being used for the NFS server, whether explicitly configured or discovered through portmapper.
    • getMountPort

      default int getMountPort()
      Return the configured MOUNT TCP destination port, or the last discovered MOUNT port. This method performs no network calls. A return value of 0 means unknown, for example when a supplied root handle has avoided MOUNT service discovery. The default preserves compatibility with existing Nfs implementations.
      Returns:
      the MOUNT port, or 0 if unknown
    • getServer

      String getServer()
      Returns the address of the machine hosting the NFS server.
    • newFile

      F newFile(String path) throws IOException
      Convenience method to create an nfs file from this client and the path.
      Parameters:
      path - The file's path from the mount point.
      Returns:
      the nfs file object
      Throws:
      IOException
    • nullCall

      Xdr nullCall() throws IOException
      Procedure NULL does not do any work. It is made available to allow server response testing and timing. For details, see RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Returns:
      the returned Xdr
      Throws:
      IOException
    • makeGetAttrRequest

      NfsGetAttrRequest makeGetAttrRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, 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).

      Parameters:
      fileHandle - The file handle of an object whose attributes are to be retrieved.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getAttr

      Bare implementation of the NFS RPC call. The details are 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).

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getAttr

      NfsGetAttrResponse wrapped_getAttr(NfsGetAttrRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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).

      Returns:
      the response
      Throws:
      IOException
    • makeSetAttrRequest

      NfsSetAttrRequest makeSetAttrRequest(byte[] fileHandle, NfsSetAttributes attributes, NfsTime guardTime) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - The file handle for the object.
      attributes - The attributes to set.
      guardTime - If guardTime is not null, the server must compare the value of guardTime to 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:
      FileNotFoundException
    • setAttr

      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_setAttr

      NfsSetAttrResponse wrapped_setAttr(NfsSetAttrRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • makeLookupRequest

      NfsLookupRequest makeLookupRequest(byte[] fileHandle, String name) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - The file handle for the directory to search.
      name - The filename to be searched for.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getLookup

      NfsLookupResponse getLookup(NfsLookupRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getLookup

      NfsLookupResponse wrapped_getLookup(NfsLookupRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • makeAccessRequest

      NfsAccessRequest makeAccessRequest(byte[] fileHandle, long accessToCheck) throws FileNotFoundException
      Creates the request, 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.

      Parameters:
      fileHandle - The file handle for the file system object to which access is to be checked.
      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:
      FileNotFoundException
    • getAccess

      NfsAccessResponse getAccess(NfsAccessRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getAccess

      NfsAccessResponse wrapped_getAccess(NfsAccessRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • makeReadlinkRequest

      NfsReadlinkRequest makeReadlinkRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - the fileHandle for the symbolic link
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getReadlink

      NfsReadlinkResponse getReadlink(NfsReadlinkRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReadlink

      NfsReadlinkResponse wrapped_getReadlink(NfsReadlinkRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • makeReadRequest

      NfsReadRequest makeReadRequest(byte[] fileHandle, long offset, int size) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READ reads data from a file.

      Parameters:
      fileHandle - The file handle of the file from which data is to be read. This must identify a file system object of type, NF3REG.
      offset - The position within the file at which the read is to begin. An offset of 0 means to read data starting at the beginning of the file. If offset is greater than or equal to the size of the file, the status, NFS3_OK, is returned with size set to 0 and eof set to true, subject to access permissions checking.
      size - The number of bytes of data that are to be read. If size is 0, the READ will succeed and return 0 bytes of data, subject to access permissions checking. size must be less than or equal to the value of the rtmax field in the FSINFO reply structure for the file system that contains file. If greater, the server may return only rtmax bytes, resulting in a short read.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getRead

      NfsReadResponse getRead(NfsReadRequest request, byte[] bytes, int position) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READ reads data from a file.

      Parameters:
      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
    • wrapped_getRead

      NfsReadResponse wrapped_getRead(NfsReadRequest request, byte[] bytes, int position) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure READ reads data from a file.

      Parameters:
      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
    • makeWriteRequest

      NfsWriteRequest makeWriteRequest(byte[] fileHandle, long offset, List<ByteBuffer> payload, int syncType) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure WRITE writes data to a file.

      Parameters:
      fileHandle - The file handle for the file to which data is to be written. This must identify a file system object of type, NF3REG.
      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:
      FileNotFoundException
    • sendWrite

      NfsWriteResponse sendWrite(NfsWriteRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure WRITE writes data to a file.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendWrite

      NfsWriteResponse wrapped_sendWrite(NfsWriteRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure WRITE writes data to a file.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendWrite

      NfsWriteResponse wrapped_sendWrite(NfsWriteRequest request, Long verifier) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure WRITE writes data to a file.

      Parameters:
      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
    • makeCreateRequest

      NfsCreateRequest makeCreateRequest(NfsCreateMode createMode, byte[] parentDirectoryFileHandle, String name, NfsSetAttributes attributes, byte[] verifier) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure CREATE creates a regular file.

      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.
      parentDirectoryFileHandle - The file handle for the directory in which the file is to be created.
      name - The name that is to be associated with the created file.
      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:
      FileNotFoundException
    • sendCreate

      NfsCreateResponse sendCreate(NfsCreateRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure CREATE creates a regular file.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendCreate

      NfsCreateResponse wrapped_sendCreate(NfsCreateRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure CREATE creates a regular file.

      Returns:
      the response
      Throws:
      IOException
    • makeMkdirRequest

      NfsMkdirRequest makeMkdirRequest(byte[] fileHandle, String name, NfsSetAttributes attributes) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure MKDIR creates a new subdirectory.

      Parameters:
      fileHandle - The file handle for the directory in which the subdirectory is to be created.
      name - The name that is to be associated with the created subdirectory.
      attributes - The initial attributes for the subdirectory.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendMkdir

      NfsMkdirResponse sendMkdir(NfsMkdirRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure MKDIR creates a new subdirectory.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendMkdir

      NfsMkdirResponse wrapped_sendMkdir(NfsMkdirRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure MKDIR creates a new subdirectory.

      Returns:
      the response
      Throws:
      IOException
    • makeSymlinkRequest

      NfsSymlinkRequest makeSymlinkRequest(String symbolicLinkData, byte[] fileHandle, String name, NfsSetAttributes attributes) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure SYMLINK creates a new symbolic link.

      Parameters:
      symbolicLinkData - The string containing the symbolic link data.
      fileHandle - The file handle for the directory in which the symbolic link is to be created.
      name - The name that is to be associated with the created symbolic link.
      attributes - The initial attributes for the symbolic link.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendSymlink

      NfsSymlinkResponse sendSymlink(NfsSymlinkRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure SYMLINK creates a new symbolic link.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendSymlink

      NfsSymlinkResponse wrapped_sendSymlink(NfsSymlinkRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure SYMLINK creates a new symbolic link.

      Returns:
      the response
      Throws:
      IOException
    • makeMknodRequest

      NfsMknodRequest makeMknodRequest(byte[] fileHandle, String name, NfsType type, NfsSetAttributes attributes, long[] rdev) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - The file handle for the directory in which the special file is to be created.
      name - The name that is to be associated with the created special file.
      type - The type of the object to be created.
      attributes - The initial attributes for the special file.
      rdev - When creating a character special file (type is NF3CHR) or a block special file ( type is NF3BLK), rdev[0] is the major number and rdev[1] is the minor number.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendMknod

      NfsMknodResponse sendMknod(NfsMknodRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendMknod

      NfsMknodResponse wrapped_sendMknod(NfsMknodRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • makeRemoveRequest

      NfsRemoveRequest makeRemoveRequest(byte[] fileHandle, String name) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - The file handle for the directory from which the entry is to be removed.
      name - The name of the entry to be removed.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendRemove

      NfsRemoveResponse sendRemove(NfsRemoveRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendRemove

      NfsRemoveResponse wrapped_sendRemove(NfsRemoveRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • makeRmdirRequest

      NfsRmdirRequest makeRmdirRequest(byte[] fileHandle, String name) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - The file handle for the directory from which the subdirectory is to be removed.
      name - The name of the subdirectory to be removed.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendRmdir

      NfsRmdirResponse sendRmdir(NfsRmdirRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendRmdir

      NfsRmdirResponse wrapped_sendRmdir(NfsRmdirRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • makeRenameRequest

      NfsRenameRequest makeRenameRequest(byte[] fileHandle, String name, byte[] toFileHandle, String toName) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure RENAME renames the file identified by name in the directory, fileHandle, to toName in the directory, toFileHandle. The operation is required to be atomic to the client. toFileHandle and fileHandle must reside on the same file system and server.

      Parameters:
      fileHandle - The file handle for the directory from which the entry is to be renamed
      name - The name of the entry that identifies the object to be renamed
      toFileHandle - The file handle for the directory to which the object is to be renamed.
      toName - The new name for the object.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendRename

      NfsRenameResponse sendRename(NfsRenameRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure RENAME renames the file identified by name in the directory, fileHandle, to toName in the directory, toFileHandle. The operation is required to be atomic to the client. toFileHandle and fileHandle must reside on the same file system and server.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendRename

      NfsRenameResponse wrapped_sendRename(NfsRenameRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure RENAME renames the file identified by name in the directory, fileHandle, to toName in the directory, toFileHandle. The operation is required to be atomic to the client. toFileHandle and fileHandle must reside on the same file system and server.

      Returns:
      the response
      Throws:
      IOException
    • makeLinkRequest

      NfsLinkRequest makeLinkRequest(byte[] fileHandle, byte[] parentDirectoryFileHandle, String name) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure LINK creates a hard link from fileHandle to name, in the directory, parentDirectoryFileHandle. fileHandle and parentDirectoryFileHandle must reside on the same file system and server.

      Parameters:
      fileHandle - The file handle for the existing file system object.
      parentDirectoryFileHandle - The file handle for the directory in which the link is to be created.
      name - The name that is to be associated with the created link.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • sendLink

      NfsLinkResponse sendLink(NfsLinkRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure LINK creates a hard link from fileHandle to name, in the directory, parentDirectoryFileHandle. fileHandle and parentDirectoryFileHandle must reside on the same file system and server.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendLink

      NfsLinkResponse wrapped_sendLink(NfsLinkRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure LINK creates a hard link from fileHandle to name, in the directory, parentDirectoryFileHandle. fileHandle and parentDirectoryFileHandle must reside on the same file system and server.

      Returns:
      the response
      Throws:
      IOException
    • makeReaddirRequest

      NfsReaddirRequest makeReaddirRequest(byte[] fileHandle, long cookie, long cookieverf, int count) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - The file handle for the directory to be read.
      cookie - This should be set to 0 in the first request to read the directory. On subsequent requests, it should be a cookie as 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 a cookieverf as returned by the server. The cookieverf must match that returned by the READDIR in which the cookie was 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:
      FileNotFoundException
    • getReaddir

      NfsReaddirResponse getReaddir(NfsReaddirRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReaddir

      NfsReaddirResponse wrapped_getReaddir(NfsReaddirRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReaddir

      NfsReaddirResponse wrapped_getReaddir(NfsReaddirRequest request, List<NfsDirectoryEntry> entries) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Parameters:
      entries - A list of entries to which the returned entries should be appended.
      Returns:
      the response
      Throws:
      IOException
    • makeReaddirplusRequest

      NfsReaddirplusRequest makeReaddirplusRequest(byte[] fileHandle, long cookie, long cookieverf, int dircount, int maxcount) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - The file handle for the directory to be read.
      cookie - This should be set to 0 in the first request to read the directory. On subsequent requests, it should be a cookie as 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 a cookieverf as returned by the server. The cookieverf must match that returned by the READDIRPLUS in which the cookie was 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 than maxcount bytes of data.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getReaddirplus

      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReaddirplus

      NfsReaddirplusResponse wrapped_getReaddirplus(NfsReaddirplusRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getReaddirplus

      NfsReaddirplusResponse wrapped_getReaddirplus(NfsReaddirplusRequest request, List<NfsDirectoryPlusEntry> entries) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Parameters:
      entries - A list of entries to which the returned entries should be appended.
      Returns:
      the response
      Throws:
      IOException
    • getNfsFsStat

      NfsFsStat getNfsFsStat() throws IOException
      Procedure FSSTAT retrieves volatile file system state information, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813), using the root handle for the exported filesystem.
      Returns:
      the data
      Throws:
      IOException
    • makeFsStatRequest

      NfsFsStatRequest makeFsStatRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure FSSTAT retrieves volatile file system state information.

      Parameters:
      fileHandle - A file handle identifying a object in the file system. This is normally a file handle for a mount point for a file system, as originally obtained from the MOUNT service on the server.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • makeFsStatRequest

      NfsFsStatRequest makeFsStatRequest() throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This method uses the root file handle for this client.

      Procedure FSSTAT retrieves volatile file system state information.

      Returns:
      the request
      Throws:
      FileNotFoundException
    • getFsStat

      NfsFsStatResponse getFsStat(NfsFsStatRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure FSSTAT retrieves volatile file system state information.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getFsStat

      NfsFsStatResponse wrapped_getFsStat(NfsFsStatRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).

      Procedure FSSTAT retrieves volatile file system state information.

      Returns:
      the response
      Throws:
      IOException
    • getNfsFsInfo

      NfsFsInfo getNfsFsInfo() throws IOException
      Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813), using the root handle for the exported filesystem.
      Returns:
      the data
      Throws:
      IOException
    • makeFsInfoRequest

      NfsFsInfoRequest makeFsInfoRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - A file handle identifying a file object. Normal usage is to provide a file handle for a mount point for a file system, as originally obtained from the MOUNT service on the server.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • makeFsInfoRequest

      NfsFsInfoRequest makeFsInfoRequest() throws FileNotFoundException
      Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This method uses the root file handle for this client.

      Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation.

      Returns:
      the request
      Throws:
      FileNotFoundException
    • getFsInfo

      NfsFsInfoResponse getFsInfo(NfsFsInfoRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getFsInfo

      NfsFsInfoResponse wrapped_getFsInfo(NfsFsInfoRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • makePathconfRequest

      NfsPathconfRequest makePathconfRequest(byte[] fileHandle) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - The file handle for the file system object.
      Returns:
      the request
      Throws:
      FileNotFoundException
    • getPathconf

      NfsPathconfResponse getPathconf(NfsPathconfRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_getPathconf

      NfsPathconfResponse wrapped_getPathconf(NfsPathconfRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • makeCommitRequest

      NfsCommitRequest makeCommitRequest(byte[] fileHandle, long offsetToCommit, int dataSizeToCommit) throws FileNotFoundException
      Convenience method for creating the request, 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.

      Parameters:
      fileHandle - The file handle for the file to which data is to be flushed (committed). This must identify a file system object of type, NF3REG.
      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:
      FileNotFoundException
    • sendCommit

      NfsCommitResponse sendCommit(NfsCommitRequest request) throws IOException
      Bare implementation of the NFS RPC call. The details are 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.

      Returns:
      the response
      Throws:
      IOException
    • wrapped_sendCommit

      NfsCommitResponse wrapped_sendCommit(NfsCommitRequest request) throws IOException
      Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging. The details are 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.

      Returns:
      the response
      Throws:
      IOException