Class Nfs3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum size in bytes.static final intThe timeout in seconds.static final intThe NFS version number.Fields inherited from interface Nfs
ACCESS3_DELETE, ACCESS3_EXECUTE, ACCESS3_EXTEND, ACCESS3_LOOKUP, ACCESS3_MODIFY, ACCESS3_READ, MOUNTPROG, NFSPROC3_ACCESS, NFSPROC3_COMMIT, NFSPROC3_CREATE, NFSPROC3_FSINFO, NFSPROC3_FSSTAT, NFSPROC3_GETATTR, NFSPROC3_LINK, NFSPROC3_LOOKUP, NFSPROC3_MKDIR, NFSPROC3_MKNOD, NFSPROC3_NULL, NFSPROC3_PATHCONF, NFSPROC3_READ, NFSPROC3_READDIR, NFSPROC3_READDIRPLUS, NFSPROC3_READLINK, NFSPROC3_REMOVE, NFSPROC3_RENAME, NFSPROC3_RMDIR, NFSPROC3_SETATTR, NFSPROC3_SYMLINK, NFSPROC3_WRITE, RPC_PROGRAM -
Constructor Summary
ConstructorsConstructorDescriptionConvenience constructorNfs3(String absolutePath, Credential credential, int maximumRetries) Convenience constructorConvenience constructorNfs3(String server, String exportedPath, byte[] rootFileHandle, Credential credential, int maximumRetries) Full constructor.Nfs3(String server, String exportedPath, byte[] rootFileHandle, Credential credential, int maximumRetries, int nfsPort, int mountPort) Full constructor with optional explicit TCP destination ports.Nfs3(String server, String exportedPath, Credential credential, int maximumRetries) Convenience constructorNfs3(String server, String exportedPath, Credential credential, int maximumRetries, int nfsPort, int mountPort) Create a client with independently configurable NFS and MOUNT TCP destination ports. -
Method Summary
Modifier and TypeMethodDescriptionvoidReturn to the default Credential.voidenableSudo(int uid, int gid) Use a custom Credential.voidgetAccess(NfsAccessRequest request) Bare implementation of the NFS RPC call.getAttr(NfsGetAttrRequest request) Bare implementation of the NFS RPC call.Returns the Credential used for RPC calls.Returns the path on the filesystem that is exported by the NFS server.getFsInfo(NfsFsInfoRequest request) Bare implementation of the NFS RPC call.getFsStat(NfsFsStatRequest request) Bare implementation of the NFS RPC call.getLookup(NfsLookupRequest request) Bare implementation of the NFS RPC call.intReturn the configured MOUNT TCP destination port, or the last discovered MOUNT port.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.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.getPathconf(NfsPathconfRequest request) Bare implementation of the NFS RPC call.intgetPort()Returns the TCP destination port being used for the NFS server, whether explicitly configured or discovered through portmapper.getRead(NfsReadRequest request, byte[] bytes, int position) Bare implementation of the NFS RPC call.getReaddir(NfsReaddirRequest request) Bare implementation of the NFS RPC call.getReaddirplus(NfsReaddirplusRequest request) Bare implementation of the NFS RPC call.getReadlink(NfsReadlinkRequest request) Bare implementation of the NFS RPC call.byte[]Returns the root file handle of the exported filesystem, for debugging and naked API calls.Returns the address of the machine hosting the NFS server.makeAccessRequest(byte[] fileHandle, long accessToCheck) Creates the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeCommitRequest(byte[] fileHandle, long offsetToCommit, int dataSizeToCommit) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeCreateRequest(NfsCreateMode createMode, byte[] parentDirectoryFileHandle, String name, NfsSetAttributes attributes, byte[] verifier) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeFsInfoRequest(byte[] fileHandle) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeFsStatRequest(byte[] fileHandle) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeGetAttrRequest(byte[] fileHandle) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeLinkRequest(byte[] fileHandle, byte[] parentDirectoryFileHandle, String name) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeLookupRequest(byte[] fileHandle, String name) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeMkdirRequest(byte[] parentDirectoryFileHandle, String name, NfsSetAttributes attributes) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeMknodRequest(byte[] parentDirectoryFileHandle, String name, NfsType type, NfsSetAttributes attributes, long[] rdev) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makePathconfRequest(byte[] fileHandle) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeReaddirplusRequest(byte[] directoryFileHandle, long cookie, long cookieverf, int dircount, int maxcount) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeReaddirRequest(byte[] directoryFileHandle, long cookie, long cookieverf, int count) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeReadlinkRequest(byte[] fileHandle) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeReadRequest(byte[] fileHandle, long offset, int size) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeRemoveRequest(byte[] parentDirectoryFileHandle, String name) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeRenameRequest(byte[] fromDirectoryFileHandle, String fromName, byte[] toDirectoryFileHandle, String toName) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeRmdirRequest(byte[] parentDirectoryFileHandle, String name) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeSetAttrRequest(byte[] fileHandle, NfsSetAttributes attributes, NfsTime guardTime) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeSymlinkRequest(String symbolicLinkData, byte[] parentDirectoryFileHandle, String name, NfsSetAttributes attributes) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).makeWriteRequest(byte[] fileHandle, long offset, List<ByteBuffer> payload, int syncType) Convenience method for creating the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Convenience method to create an nfs file from this client and the path.nullCall()Procedure NULL does not do any work.intread(String path, byte[] fileHandle, long offset, int length, byte[] data, int pos, org.apache.commons.lang3.mutable.MutableBoolean eof) Read data from a file handlesendCommit(NfsCommitRequest request) Bare implementation of the NFS RPC call.sendCreate(NfsCreateRequest request) Bare implementation of the NFS RPC call.sendLink(NfsLinkRequest request) Bare implementation of the NFS RPC call.sendMkdir(NfsMkdirRequest request) Bare implementation of the NFS RPC call.sendMknod(NfsMknodRequest request) Bare implementation of the NFS RPC call.sendRemove(NfsRemoveRequest request) Bare implementation of the NFS RPC call.sendRename(NfsRenameRequest request) Bare implementation of the NFS RPC call.sendRmdir(NfsRmdirRequest request) Bare implementation of the NFS RPC call.sendSymlink(NfsSymlinkRequest request) Bare implementation of the NFS RPC call.sendWrite(NfsWriteRequest request) Bare implementation of the NFS RPC call.setAttr(NfsSetAttrRequest request) Bare implementation of the NFS RPC call.wrapped_getAccess(NfsAccessRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getAttr(NfsGetAttrRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getFsInfo(NfsFsInfoRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getFsStat(NfsFsStatRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getLookup(NfsLookupRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getPathconf(NfsPathconfRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getRead(NfsReadRequest request, byte[] bytes, int position) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getReaddir(NfsReaddirRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getReaddir(NfsReaddirRequest request, List<NfsDirectoryEntry> entries) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getReaddirplus(NfsReaddirplusRequest request, List<NfsDirectoryPlusEntry> entries) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_getReadlink(NfsReadlinkRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendCommit(NfsCommitRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendCreate(NfsCreateRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendLink(NfsLinkRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendMkdir(NfsMkdirRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendMknod(NfsMknodRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendRemove(NfsRemoveRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendRename(NfsRenameRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendRmdir(NfsRmdirRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendSymlink(NfsSymlinkRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendWrite(NfsWriteRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_sendWrite(NfsWriteRequest request, Long verifier) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.wrapped_setAttr(NfsSetAttrRequest request) Implementation of the NFS RPC call, wrapped to include repeated attempts, error checking, and logging.
-
Field Details
-
VERSION
public static final int VERSIONThe NFS version number.- See Also:
-
NFS_TIMEOUT
public static final int NFS_TIMEOUTThe timeout in seconds.- See Also:
-
MAXIMUM_NFS_REQUEST_SIZE
public static final int MAXIMUM_NFS_REQUEST_SIZEThe maximum size in bytes. 8K is enough for all requests except for data writing.- See Also:
-
-
Constructor Details
-
Nfs3
public Nfs3(String server, String exportedPath, byte[] rootFileHandle, int maximumRetries) throws IOException Convenience constructor- Throws:
IOException
-
Nfs3
public Nfs3(String server, String exportedPath, Credential credential, int maximumRetries) throws IOException Convenience constructor- Throws:
IOException
-
Nfs3
Convenience constructor- Parameters:
absolutePath- The fully qualified path to the export, e.g., 10.32.172.64:/store.- Throws:
IOException
-
Nfs3
Convenience constructor- Parameters:
absolutePath- The fully qualified path to the export, e.g., 10.32.172.64:/store.- Throws:
IOException
-
Nfs3
public Nfs3(String server, String exportedPath, byte[] rootFileHandle, Credential credential, int maximumRetries) throws IOException Full constructor.- Parameters:
server- The NFS server name or IP address.exportedPath- The exported path- Throws:
IOException
-
Nfs3
public Nfs3(String server, String exportedPath, Credential credential, int maximumRetries, int nfsPort, int mountPort) throws IOException Create a client with independently configurable NFS and MOUNT TCP destination ports.- Parameters:
server- the NFS server name or IP address (without a port)exportedPath- the exported pathcredential- RPC credential, or null for the default UNIX credentialmaximumRetries- positive maximum number of NFS call attemptsnfsPort- NFS port (1-65535), or 0 to discover through portmappermountPort- MOUNT port (1-65535), or 0 to discover through portmapper- Throws:
IOException- if service discovery or mounting failsIllegalArgumentException- if a port is outside 0-65535
-
Nfs3
public Nfs3(String server, String exportedPath, byte[] rootFileHandle, Credential credential, int maximumRetries, int nfsPort, int mountPort) throws IOException Full constructor with optional explicit TCP destination ports. A nonzero port bypasses portmapper for that service, including when the root handle is refreshed. Supplying a root handle skips MOUNT; with an explicit NFS port it also skips all portmapper discovery. Existing constructors are equivalent to specifying 0 for both ports.- Parameters:
server- the NFS server name or IP address (without a port)exportedPath- the exported pathrootFileHandle- root file handle, or null to obtain it using MOUNTcredential- RPC credential, or null for the default UNIX credentialmaximumRetries- positive maximum number of NFS call attemptsnfsPort- NFS port (1-65535), or 0 to discover through portmappermountPort- MOUNT port (1-65535), or 0 to discover through portmapper- Throws:
IOException- if service discovery or mounting failsIllegalArgumentException- if a port is outside 0-65535
-
-
Method Details
-
disableSudo
Return to the default Credential.- Specified by:
disableSudoin interfaceNfs<Nfs3File>- Throws:
IOException
-
enableSudo
public void enableSudo(int uid, int gid) Use a custom Credential.- Specified by:
enableSudoin interfaceNfs<Nfs3File>- Parameters:
uid- Unix uidgid- Unix gid
-
getCredential
Returns the Credential used for RPC calls.- Specified by:
getCredentialin interfaceNfs<Nfs3File>
-
getExportedPath
Returns the path on the filesystem that is exported by the NFS server.- Specified by:
getExportedPathin interfaceNfs<Nfs3File>
-
newFile
Convenience method to create an nfs file from this client and the path.- Specified by:
newFilein interfaceNfs<Nfs3File>- Parameters:
path- The file's path from the mount point.- Returns:
- the nfs file object
- Throws:
IOException
-
getPort
-
getMountPort
public int getMountPort()Description copied from interface:NfsReturn 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.- Specified by:
getMountPortin interfaceNfs<Nfs3File>- Returns:
- the MOUNT port, or 0 if unknown
-
getRootFileHandle
public byte[] getRootFileHandle()Returns the root file handle of the exported filesystem, for debugging and naked API calls.- Specified by:
getRootFileHandlein interfaceNfs<Nfs3File>
-
getServer
-
nullCall
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).- Specified by:
nullCallin interfaceNfs<Nfs3File>- Returns:
- the returned Xdr
- Throws:
IOException
-
makeGetAttrRequest
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).
- Specified by:
makeGetAttrRequestin interfaceNfs<Nfs3File>- 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).
- Specified by:
getAttrin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getAttr
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).
- Specified by:
wrapped_getAttrin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeSetAttrRequest
public 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.
- Specified by:
makeSetAttrRequestin interfaceNfs<Nfs3File>- Parameters:
fileHandle- The file handle for the object.attributes- The attributes to set.guardTime- IfguardTimeis not null, the server must compare the value ofguardTimeto the current ctime of the object. If the values are different, the server must preserve the object attributes and must return a status of NFS3ERR_NOT_SYNC.- Returns:
- the request
- Throws:
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.
- Specified by:
setAttrin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_setAttr
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.
- Specified by:
wrapped_setAttrin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeLookupRequest
public Nfs3LookupRequest 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.
- Specified by:
makeLookupRequestin interfaceNfs<Nfs3File>- Parameters:
fileHandle- The file handle for the directory to search.name- The filename to be searched for.- Returns:
- the request
- Throws:
FileNotFoundException
-
getLookup
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.
- Specified by:
getLookupin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getLookup
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.
- Specified by:
wrapped_getLookupin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeAccessRequest
public Nfs3AccessRequest 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.
- Specified by:
makeAccessRequestin interfaceNfs<Nfs3File>- 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
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.
- Specified by:
getAccessin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getAccess
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.
- Specified by:
wrapped_getAccessin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeReadlinkRequest
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.
- Specified by:
makeReadlinkRequestin interfaceNfs<Nfs3File>- Parameters:
fileHandle- the fileHandle for the symbolic link- Returns:
- the request
- Throws:
FileNotFoundException
-
getReadlink
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.
- Specified by:
getReadlinkin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getReadlink
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.
- Specified by:
wrapped_getReadlinkin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeReadRequest
public Nfs3ReadRequest 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.
- Specified by:
makeReadRequestin interfaceNfs<Nfs3File>- 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. Anoffsetof 0 means to read data starting at the beginning of the file. Ifoffsetis greater than or equal to the size of the file, the status, NFS3_OK, is returned withsizeset to 0 andeofset totrue, subject to access permissions checking.size- The number of bytes of data that are to be read. Ifsizeis 0, the READ will succeed and return 0 bytes of data, subject to access permissions checking.sizemust be less than or equal to the value of thertmaxfield in the FSINFO reply structure for the file system that contains file. If greater, the server may return onlyrtmaxbytes, resulting in a short read.- Returns:
- the request
- Throws:
FileNotFoundException
-
getRead
public Nfs3ReadResponse 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.
- Specified by:
getReadin interfaceNfs<Nfs3File>- 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
public Nfs3ReadResponse 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.
- Specified by:
wrapped_getReadin interfaceNfs<Nfs3File>- 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
public Nfs3WriteRequest 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.
- Specified by:
makeWriteRequestin interfaceNfs<Nfs3File>- 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
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.
- Specified by:
sendWritein interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendWrite
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.
- Specified by:
wrapped_sendWritein interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendWrite
public Nfs3WriteResponse 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.
- Specified by:
wrapped_sendWritein interfaceNfs<Nfs3File>- 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
public Nfs3CreateRequest 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.
- Specified by:
makeCreateRequestin interfaceNfs<Nfs3File>- 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
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.
- Specified by:
sendCreatein interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendCreate
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.
- Specified by:
wrapped_sendCreatein interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeMkdirRequest
public Nfs3MkdirRequest makeMkdirRequest(byte[] parentDirectoryFileHandle, 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.
- Specified by:
makeMkdirRequestin interfaceNfs<Nfs3File>- Parameters:
parentDirectoryFileHandle- 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
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.
- Specified by:
sendMkdirin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendMkdir
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.
- Specified by:
wrapped_sendMkdirin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeSymlinkRequest
public Nfs3SymlinkRequest makeSymlinkRequest(String symbolicLinkData, byte[] parentDirectoryFileHandle, 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.
- Specified by:
makeSymlinkRequestin interfaceNfs<Nfs3File>- Parameters:
symbolicLinkData- The string containing the symbolic link data.parentDirectoryFileHandle- 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
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.
- Specified by:
sendSymlinkin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendSymlink
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.
- Specified by:
wrapped_sendSymlinkin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeMknodRequest
public Nfs3MknodRequest makeMknodRequest(byte[] parentDirectoryFileHandle, 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.- Specified by:
makeMknodRequestin interfaceNfs<Nfs3File>- Parameters:
parentDirectoryFileHandle- 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 (typeisNF3CHR) or a block special file (typeisNF3BLK),rdev[0]is the major number andrdev[1]is the minor number.- Returns:
- the request
- Throws:
FileNotFoundException
-
sendMknod
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.- Specified by:
sendMknodin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendMknod
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.- Specified by:
wrapped_sendMknodin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeRemoveRequest
public Nfs3RemoveRequest makeRemoveRequest(byte[] parentDirectoryFileHandle, 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.
- Specified by:
makeRemoveRequestin interfaceNfs<Nfs3File>- Parameters:
parentDirectoryFileHandle- 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
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.
- Specified by:
sendRemovein interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendRemove
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.
- Specified by:
wrapped_sendRemovein interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeRmdirRequest
public Nfs3RmdirRequest makeRmdirRequest(byte[] parentDirectoryFileHandle, 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.
- Specified by:
makeRmdirRequestin interfaceNfs<Nfs3File>- Parameters:
parentDirectoryFileHandle- 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
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.
- Specified by:
sendRmdirin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendRmdir
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.
- Specified by:
wrapped_sendRmdirin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeRenameRequest
public Nfs3RenameRequest makeRenameRequest(byte[] fromDirectoryFileHandle, String fromName, byte[] toDirectoryFileHandle, 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
namein the directory,fileHandle, totoNamein the directory,toFileHandle. The operation is required to be atomic to the client.toFileHandleandfileHandlemust reside on the same file system and server.- Specified by:
makeRenameRequestin interfaceNfs<Nfs3File>- Parameters:
fromDirectoryFileHandle- The file handle for the directory from which the entry is to be renamedfromName- The name of the entry that identifies the object to be renamedtoDirectoryFileHandle- 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
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
namein the directory,fileHandle, totoNamein the directory,toFileHandle. The operation is required to be atomic to the client.toFileHandleandfileHandlemust reside on the same file system and server.- Specified by:
sendRenamein interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendRename
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
namein the directory,fileHandle, totoNamein the directory,toFileHandle. The operation is required to be atomic to the client.toFileHandleandfileHandlemust reside on the same file system and server.- Specified by:
wrapped_sendRenamein interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeLinkRequest
public Nfs3LinkRequest 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
fileHandletoname, in the directory,parentDirectoryFileHandle.fileHandleandparentDirectoryFileHandlemust reside on the same file system and server.- Specified by:
makeLinkRequestin interfaceNfs<Nfs3File>- 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
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
fileHandletoname, in the directory,parentDirectoryFileHandle.fileHandleandparentDirectoryFileHandlemust reside on the same file system and server.- Specified by:
sendLinkin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendLink
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
fileHandletoname, in the directory,parentDirectoryFileHandle.fileHandleandparentDirectoryFileHandlemust reside on the same file system and server.- Specified by:
wrapped_sendLinkin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeReaddirRequest
public NfsReaddirRequest makeReaddirRequest(byte[] directoryFileHandle, 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.
- Specified by:
makeReaddirRequestin interfaceNfs<Nfs3File>- Parameters:
directoryFileHandle- 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 acookieas returned by the server.cookieverf- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieverfas returned by the server. Thecookieverfmust match that returned by the READDIR in which thecookiewas acquired.count- The maximum size of the READDIR3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less than count bytes of data.- Returns:
- the request
- Throws:
FileNotFoundException
-
getReaddir
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.
- Specified by:
getReaddirin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getReaddir
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.
- Specified by:
wrapped_getReaddirin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getReaddir
public Nfs3ReaddirResponse 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.
- Specified by:
wrapped_getReaddirin interfaceNfs<Nfs3File>- Parameters:
entries- A list of entries to which the returned entries should be appended.- Returns:
- the response
- Throws:
IOException
-
makeReaddirplusRequest
public NfsReaddirplusRequest makeReaddirplusRequest(byte[] directoryFileHandle, 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.
- Specified by:
makeReaddirplusRequestin interfaceNfs<Nfs3File>- Parameters:
directoryFileHandle- 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 acookieas returned by the server.cookieverf- This should be set to 0 in the first request to read the directory. On subsequent requests, it should be acookieverfas returned by the server. Thecookieverfmust match that returned by the READDIRPLUS in which thecookiewas acquired.dircount- The maximum number of bytes of directory information returned. This number should not include the size of the attributes and file handle portions of the result.maxcount- The maximum size of the READDIRPLUS3resok structure, in bytes. The size must include all XDR overhead. The server is free to return less thanmaxcountbytes of data.- Returns:
- the request
- Throws:
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.
- Specified by:
getReaddirplusin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getReaddirplus
public Nfs3ReaddirplusResponse 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.
- Specified by:
wrapped_getReaddirplusin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getReaddirplus
public Nfs3ReaddirplusResponse 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.
- Specified by:
wrapped_getReaddirplusin interfaceNfs<Nfs3File>- Parameters:
entries- A list of entries to which the returned entries should be appended.- Returns:
- the response
- Throws:
IOException
-
getNfsFsStat
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.- Specified by:
getNfsFsStatin interfaceNfs<Nfs3File>- Returns:
- the data
- Throws:
IOException
-
makeFsStatRequest
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.
- Specified by:
makeFsStatRequestin interfaceNfs<Nfs3File>- 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
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.
- Specified by:
makeFsStatRequestin interfaceNfs<Nfs3File>- Returns:
- the request
- Throws:
FileNotFoundException
-
getFsStat
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.
- Specified by:
getFsStatin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getFsStat
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.
- Specified by:
wrapped_getFsStatin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
getNfsFsInfo
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.- Specified by:
getNfsFsInfoin interfaceNfs<Nfs3File>- Returns:
- the data
- Throws:
IOException
-
makeFsInfoRequest
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.
- Specified by:
makeFsInfoRequestin interfaceNfs<Nfs3File>- 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
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.
- Specified by:
makeFsInfoRequestin interfaceNfs<Nfs3File>- Returns:
- the request
- Throws:
FileNotFoundException
-
getFsInfo
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.
- Specified by:
getFsInfoin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getFsInfo
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.
- Specified by:
wrapped_getFsInfoin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makePathconfRequest
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.
- Specified by:
makePathconfRequestin interfaceNfs<Nfs3File>- Parameters:
fileHandle- The file handle for the file system object.- Returns:
- the request
- Throws:
FileNotFoundException
-
getPathconf
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.
- Specified by:
getPathconfin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_getPathconf
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.
- Specified by:
wrapped_getPathconfin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
makeCommitRequest
public Nfs3CommitRequest 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.
- Specified by:
makeCommitRequestin interfaceNfs<Nfs3File>- 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
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.
- Specified by:
sendCommitin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
wrapped_sendCommit
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.
- Specified by:
wrapped_sendCommitin interfaceNfs<Nfs3File>- Returns:
- the response
- Throws:
IOException
-
read
public int read(String path, byte[] fileHandle, long offset, int length, byte[] data, int pos, org.apache.commons.lang3.mutable.MutableBoolean eof) throws IOException Read data from a file handle- Parameters:
path- the path of the filefileHandle- file handle of the fileoffset- offset of the file to readlength- the length of the data bufferdata- the data to be returnedeof- is at the end-of-file- Returns:
- The number of bytes of data returned by the read. the number may be smaller than len
- Throws:
IOException
-
fsync
- Throws:
IOException
-