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

All Superinterfaces:
Comparable<F>
All Known Implementing Classes:
Nfs3File, NfsFileBase

public interface NfsFile<N extends Nfs<?>, F extends NfsFile<N,F>> extends Comparable<F>
This interface is the NFS client equivalent of java.io.File. It has been modified appropriately for manipulations of NFS files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Execute permission for group on a file.
    static final long
    Read permission for group.
    static final long
    Write permission for group.
    static final long
    Execute permission for others on a file.
    static final long
    Read permission for others.
    static final long
    Write permission for others.
    static final long
    Execute permission for owner on a file.
    static final long
    Read permission for owner.
    static final long
    Write permission for owner.
    static final long
    Save swapped text (not defined in POSIX).
    static final String
    String between names in the file path.
    static final char
    Character between names in the file path.
    static final long
    Set group ID on execution.
    static final long
    Set user ID on execution.
  • Method Summary

    Modifier and Type
    Method
    Description
    access(long accessToCheck)
    Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    boolean
    Tests whether this client can delete an existing directory entry.
    boolean
    Tests whether this client can execute this file (no meaning for a directory).
    boolean
    Tests whether this client can write new data or add directory entries.
    boolean
    Tests whether this client can look up a name in a directory (no meaning for non-directory objects).
    boolean
    Tests whether this client can rewrite existing file data or modify existing directory entries.
    boolean
    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).
    create(NfsCreateMode createMode, NfsSetAttributes attributes, byte[] verifier)
    Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    boolean
    Atomically creates a new, empty file named by path if and only if a file with this name does not yet exist.
    void
    Deletes this file/directory.
    boolean
    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.
    Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    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.
    long
    getAccess(long accessToCheck)
    Tests whether this client has the specified access permissions for this file.
    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.
    byte[]
    Returns the NFS file handle, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    long
    Returns the number of unallocated bytes in the partition named by this abstract path name.
    long
    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.
    Returns the name.
    Returns the low-level NFS client supporting this NfsFile instance.
    Returns 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.
    Returns the absolute path, from the root of the exported folders.
    long
    Returns the size of the partition named by this abstract pathname.
    long
    Returns the number of free bytes available to this client on the partition named by this abstract pathname.
    boolean
    Returns true if it is, false if it is not.
    boolean
    Returns true if it is a normal file, false if it is not.
    boolean
    Returns true if it is the root file of the mount, false if it is not.
    long
    Returns time of last modification.
    long
    Returns the length in bytes, or 0 if the file does not exist or the attributes cannot be read.
    long
    Returns the length in bytes.
    link(F source)
    Makes the RPC call for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    Lists all files in this directory.
    Lists all files matching the filter in this directory.
    Lists all files in this directory.
    Lists all files matching the filter in this directory.
    Lists all files matching the filter in this directory.
    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).
    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).
    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).
    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).
    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).
    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).
    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).
    void
    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).
    void
    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).
    newChildFile(String childName)
    Creates a new file with the current file as its parent directory.
    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).
    Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    Makes the RPC call for this file, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    rename(F toFile)
    Makes the RPC call for these files, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    boolean
    renameTo(F destination)
    Renames the file denoted by this abstract pathname.
    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).
    void
    setAttributes(NfsSetAttributes nfsSetAttributes)
    Sets NFS file attributes, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    void
    setLastModified(long millis)
    Sets the last-modified time of the file or directory named by this abstract pathname.
    void
    setMode(long mode)
    Sets the protection mode bits, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
    symlink(String symbolicLinkData, NfsSetAttributes attributes)
    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)
    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 Comparable

    compareTo
  • Field Details

    • separatorChar

      static final char separatorChar
      Character between names in the file path. Equivalent of the File interface separatorChar .
      See Also:
    • separator

      static final String separator
      String between names in the file path. Equivalent of the File interface separator.
      See Also:
    • setUserIdOnExecuteModeBit

      static final long setUserIdOnExecuteModeBit
      Set user ID on execution. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • setGroupIdOnExecuteModeBit

      static final long setGroupIdOnExecuteModeBit
      Set group ID on execution. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • saveSwappedTextModeBit

      static final long saveSwappedTextModeBit
      Save swapped text (not defined in POSIX). Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • ownerReadModeBit

      static final long ownerReadModeBit
      Read permission for owner. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • ownerWriteModeBit

      static final long ownerWriteModeBit
      Write permission for owner. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • ownerExecuteModeBit

      static final long ownerExecuteModeBit
      Execute permission for owner on a file. Or lookup (search) permission for owner in directory. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • groupReadModeBit

      static final long groupReadModeBit
      Read permission for group. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • groupWriteModeBit

      static final long groupWriteModeBit
      Write permission for group. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • groupExecuteModeBit

      static final long groupExecuteModeBit
      Execute permission for group on a file. Or lookup (search) permission for group in directory. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • othersReadModeBit

      static final long othersReadModeBit
      Read permission for others. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • othersWriteModeBit

      static final long othersWriteModeBit
      Write permission for others. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
    • othersExecuteModeBit

      static final long othersExecuteModeBit
      Execute permission for others on a file. Or lookup (search) permission for others in directory. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      See Also:
  • Method Details

    • canDelete

      boolean canDelete() throws IOException
      Tests whether this client can delete an existing directory entry. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Returns:
      true if it can, false if it cannot
      Throws:
      IOException - if it does not exist or permissions cannot be read.
    • canExecute

      boolean canExecute() throws IOException
      Tests whether this client can execute this file (no meaning for a directory). Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Returns:
      true if it can, false if it cannot
      Throws:
      IOException - if it does not exist or permissions cannot be read.
    • canExtend

      boolean canExtend() throws IOException
      Tests whether this client can write new data or add directory entries. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Returns:
      true if it can, false if it cannot
      Throws:
      IOException - if it does not exist or permissions cannot be read.
    • canLookup

      boolean canLookup() throws IOException
      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).
      Returns:
      true if it can, false if it cannot
      Throws:
      IOException - if it does not exist or permissions cannot be read.
    • canModify

      boolean canModify() throws IOException
      Tests whether this client can rewrite existing file data or modify existing directory entries. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Returns:
      true if it can, false if it cannot
      Throws:
      IOException - if it does not exist or permissions cannot be read.
    • canRead

      boolean canRead() throws IOException
      Tests whether this client can read data from file or read a directory. Specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Returns:
      true if it can, false if it cannot
      Throws:
      IOException - if it does not exist or permissions cannot be read.
    • createNewFile

      boolean createNewFile() throws IOException
      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.
      Returns:
      true if the named file did not exist and was successfully created; false if the named file already existed.
      Throws:
      IOException - If an I/O error occurred
    • delete

      void delete() throws IOException
      Deletes this file/directory.
      Throws:
      IOException
    • exists

      boolean exists() throws IOException
      Tests whether this file exists on the NFS server.
      Returns:
      true if the file exists on the NFS server
      Throws:
      IOException
    • followLinks

      F followLinks() throws IOException
      Resolves symbolic links while tracking link traversal.
      Returns:
      The backing file obtained by following all symbolic links in the path, if any.
      Throws:
      IOException
    • followLinks

      F followLinks(LinkTracker<N,F> linkTracker) throws IOException
      Resolves symbolic links while tracking link traversal.
      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

      String 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

      long getAccess(long accessToCheck) throws IOException
      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.

      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

      NfsGetAttributes getAttributes() throws IOException
      Returns the NFS attributes, 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).
      Throws:
      IOException
    • getChildFile

      F getChildFile(String childName) throws IOException
      Returns the child file.
      Returns:
      The child file.
      Throws:
      IOException
    • getFreeSpace

      long getFreeSpace() throws IOException
      Returns the number of unallocated bytes in the partition named by this abstract path name.
      Returns:
      The number of unallocated bytes in the partition named by this abstract path name.
      Throws:
      IOException
    • getMode

      long getMode() throws IOException
      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.
      Returns:
      The protection mode bits for the file.
      Throws:
      IOException
    • getName

      String getName()
      Returns the name.
    • getParent

      String getParent()
      Returns the path of the parent folder, or null if there is none.
    • getParentFile

      F getParentFile()
      Returns the NfsFile of the parent folder, or null if there is none.
    • getPath

      String getPath()
      Returns the absolute path, from the root of the exported folders. Synonymous with getAbsolutePath().
    • getTotalSpace

      long getTotalSpace() throws IOException
      Returns the size of the partition named by this abstract pathname.
      Returns:
      The size of the partition named by this abstract pathname.
      Throws:
      IOException
    • getUsableSpace

      long getUsableSpace() throws IOException
      Returns the number of free bytes available to this client on the partition named by this abstract pathname.
      Returns:
      The number of free bytes available to this client on the partition named by this abstract pathname.
      Throws:
      IOException
    • isDirectory

      boolean isDirectory() throws IOException
      Returns true if it is, false if it is not.
      Returns:
      true if it is, false if it is not
      Throws:
      IOException
    • isFile

      boolean isFile() throws IOException
      Returns true if it is a normal file, false if it is not.
      Returns:
      true if it is a normal file, false if it is not
      Throws:
      IOException
    • isRootFile

      boolean isRootFile() throws IOException
      Returns true if it is the root file of the mount, false if it is not.
      Returns:
      true if it is the root file of the mount, false if it is not
      Throws:
      IOException
    • lastModified

      long lastModified() throws IOException
      Returns time of last modification.
      Returns:
      time of last modification
      Throws:
      IOException
    • length

      long length()
      Returns the length in bytes, or 0 if the file does not exist or the attributes cannot be read.
    • lengthEx

      long lengthEx() throws IOException
      Returns the length in bytes.
      Returns:
      the length in bytes
      Throws:
      IOException - if the file does not exist or the attributes cannot be read.
    • list

      List<String> list() throws IOException
      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.

      Returns:
      the names of all files in the directory
      Throws:
      IOException
    • list

      List<String> list(NfsFilenameFilter filter) throws IOException
      Lists all files matching the filter in this directory.

      Preserves the relative server order of accepted entries. The ordering and consistency considerations described in list() apply.

      Returns:
      the names of all files matching the filter in the directory
      Throws:
      IOException
    • listFiles

      List<F> listFiles() throws IOException
      Lists all files in this directory.

      Returns file objects in the order produced by list(), without sorting. The ordering and consistency considerations described there apply.

      Returns:
      NfsFile objects for all files in the directory
      Throws:
      IOException
    • listFiles

      List<F> listFiles(NfsFilenameFilter filter) throws IOException
      Lists all files matching the filter in this directory.

      Preserves the relative server order of accepted entries. The ordering and consistency considerations described in list() apply.

      Returns:
      NfsFile objects for all files matching the filter in the directory
      Throws:
      IOException
    • listFiles

      List<F> listFiles(NfsFileFilter filter) throws IOException
      Lists all files matching the filter in this directory.

      Preserves the relative server order of accepted entries. The ordering and consistency considerations described in list() apply.

      Returns:
      NfsFile objects for all files matching the filter in the directory
      Throws:
      IOException
    • mkdir

      void mkdir() throws IOException
      Creates the directory if it does not exist.
      Throws:
      IOException - if the parent directories do not exist or it cannot be created
    • mkdirs

      void mkdirs() throws IOException
      Creates the directory and all parent directories if they do not already exist.
      Throws:
      IOException - if it cannot create one of the directories.
    • newChildFile

      F newChildFile(String childName) throws IOException
      Creates a new file with the current file as its parent directory. This does not create the file on the NFS mount.
      Returns:
      the new file
      Throws:
      IOException
    • renameTo

      boolean renameTo(F destination) throws IOException
      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.

      Throws:
      IOException
    • setAttributes

      void setAttributes(NfsSetAttributes nfsSetAttributes) throws IOException
      Sets NFS file attributes, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Throws:
      IOException
    • setLastModified

      void setLastModified(long millis) throws IOException
      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.

      Parameters:
      millis - - The new last-modified time, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970)
      Throws:
      IOException
    • setMode

      void setMode(long mode) throws IOException
      Sets the protection mode bits, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). This replaces the java.io.File methods setExecutable, setReadable, and setWritable. 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.
      Parameters:
      mode - the protection mode bits
      Throws:
      IOException
    • getNfs

      N getNfs()
      Returns the low-level NFS client supporting this NfsFile instance.
    • getFileHandle

      byte[] getFileHandle() throws IOException
      Returns the NFS file handle, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Returns:
      The NFS file handle, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
      Throws:
      IOException
    • 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).

      Returns:
      the response
      Throws:
      IOException
    • makeGetAttrRequest

      NfsGetAttrRequest makeGetAttrRequest() throws IOException
      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).

      Returns:
      the request
      Throws:
      IOException
    • setattr

      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.

      Parameters:
      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 response
      Throws:
      IOException
    • makeSetAttrRequest

      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.

      Parameters:
      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:
      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.

      Returns:
      the response
      Throws:
      IOException
    • makeLookupRequest

      NfsLookupRequest makeLookupRequest() throws IOException
      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.

      Returns:
      the request
      Throws:
      IOException
    • access

      NfsAccessResponse access(long accessToCheck) 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 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:
      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

      NfsAccessRequest makeAccessRequest(long accessToCheck) throws IOException
      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.

      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

      NfsReadlinkResponse readlink() 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.

      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
    • makeReadlinkRequest

      NfsReadlinkRequest makeReadlinkRequest() throws IOException
      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.

      Returns:
      the request
      Throws:
      IOException
    • read

      NfsReadResponse read(long offset, int size, byte[] bytes, int position) 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 READ reads data from a file.

      Parameters:
      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.
      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

      NfsReadRequest makeReadRequest(long offset, int size) throws IOException
      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.

      Parameters:
      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:
      IOException
    • write

      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.

      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

      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.

      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

      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.

      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

      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.

      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

      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.

      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

      NfsMkdirResponse mkdir(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 MKDIR creates a new subdirectory.

      Parameters:
      attributes - The initial attributes for the subdirectory.
      Returns:
      the response
      Throws:
      IOException
    • makeMkdirRequest

      NfsMkdirRequest makeMkdirRequest(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 MKDIR creates a new subdirectory.

      Parameters:
      attributes - The initial attributes for the subdirectory.
      Returns:
      the request
      Throws:
      IOException
    • symlink

      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.

      Parameters:
      symbolicLinkData - The string containing the symbolic link data.
      attributes - The initial attributes for the symbolic link.
      Returns:
      the response
      Throws:
      IOException
    • makeSymlinkRequest

      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.

      Parameters:
      symbolicLinkData - The string containing the symbolic link data.
      attributes - The initial attributes for the symbolic link.
      Returns:
      the request
      Throws:
      IOException
    • mknod

      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.

      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 (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 response
      Throws:
      IOException
    • makeMknodRequest

      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.

      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 (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:
      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.

      Returns:
      the response
      Throws:
      IOException
    • makeRemoveRequest

      NfsRemoveRequest makeRemoveRequest() throws IOException
      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.

      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.

      Returns:
      the response
      Throws:
      IOException
    • makeRmdirRequest

      NfsRmdirRequest makeRmdirRequest() throws IOException
      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.

      Returns:
      the request
      Throws:
      IOException
    • rename

      NfsRenameResponse rename(F toFile) throws IOException
      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 and toFile must reside on the same file system and server.

      Parameters:
      toFile - A file object with the new path for this object.
      Returns:
      the response
      Throws:
      IOException
    • makeRenameRequest

      NfsRenameRequest makeRenameRequest(F toFile) throws IOException
      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 and toFile must reside on the same file system and server.

      Parameters:
      toFile - A file object with the new path for this object.
      Returns:
      the request
      Throws:
      IOException
    • link

      NfsLinkResponse link(F source) throws IOException
      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 source to this file. This file and source must reside on the same file system and server.

      Parameters:
      source - The existing file system object to which this file should be linked.
      Returns:
      the response
      Throws:
      IOException
    • makeLinkRequest

      NfsLinkRequest makeLinkRequest(F source) throws IOException
      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 source to this file. This file and source must reside on the same file system and server.

      Parameters:
      source - The existing file system object to which this file should be linked.
      Returns:
      the request
      Throws:
      IOException
    • readdir

      NfsReaddirResponse readdir(long cookie, long cookieverf, int count) 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.

      Parameters:
      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 response
      Throws:
      IOException
    • readdir

      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.

      Parameters:
      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.
      entries - A list to which the incoming data should be appended.
      Returns:
      the response
      Throws:
      IOException
    • makeReaddirRequest

      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.

      Parameters:
      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:
      IOException
    • readdirplus

      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.

      Parameters:
      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 response
      Throws:
      IOException
    • readdirplus

      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.

      Parameters:
      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.
      entries - A list to which the incoming data should be appended.
      Returns:
      the response
      Throws:
      IOException
    • makeReaddirplusRequest

      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.

      Parameters:
      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:
      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.

      Returns:
      the response
      Throws:
      IOException
    • makeFsStatRequest

      NfsFsStatRequest makeFsStatRequest() throws IOException
      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.

      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.

      Returns:
      the response
      Throws:
      IOException
    • makeFsInfoRequest

      NfsFsInfoRequest makeFsInfoRequest() throws IOException
      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.

      Returns:
      the request
      Throws:
      IOException
    • pathconf

      NfsPathconfResponse pathconf() 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 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
    • makePathconfRequest

      NfsPathconfRequest makePathconfRequest() throws IOException
      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.

      Returns:
      the request
      Throws:
      IOException
    • commit

      NfsCommitResponse commit(long offsetToCommit, int dataSizeToCommit) 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 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:
      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

      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.

      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