public interface NfsFile<N extends Nfs<?>,F extends NfsFile<N,F>>
extends java.lang.Comparable<F>
java.io.File. It
has been modified appropriately for manipulations of NFS files, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).| Modifier and Type | Field and Description |
|---|---|
static long |
groupExecuteModeBit
Execute permission for group on a file.
|
static long |
groupReadModeBit
Read permission for group.
|
static long |
groupWriteModeBit
Write permission for group.
|
static long |
othersExecuteModeBit
Execute permission for others on a file.
|
static long |
othersReadModeBit
Read permission for others.
|
static long |
othersWriteModeBit
Write permission for others.
|
static long |
ownerExecuteModeBit
Execute permission for owner on a file.
|
static long |
ownerReadModeBit
Read permission for owner.
|
static long |
ownerWriteModeBit
Write permission for owner.
|
static long |
saveSwappedTextModeBit
Save swapped text (not defined in POSIX).
|
static java.lang.String |
separator
String between names in the file path.
|
static char |
separatorChar
Character between names in the file path.
|
static long |
setGroupIdOnExecuteModeBit
Set group ID on execution.
|
static long |
setUserIdOnExecuteModeBit
Set user ID on execution.
|
| Modifier and Type | Method and Description |
|---|---|
NfsAccessResponse |
access(long accessToCheck)
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
boolean |
canDelete()
Tests whether this client can delete an existing directory entry.
|
boolean |
canExecute()
Tests whether this client can execute this file (no meaning for a
directory).
|
boolean |
canExtend()
Tests whether this client can write new data or add directory entries.
|
boolean |
canLookup()
Tests whether this client can look up a name in a directory (no meaning
for non-directory objects).
|
boolean |
canModify()
Tests whether this client can rewrite existing file data or modify
existing directory entries.
|
boolean |
canRead()
Tests whether this client can read data from file or read a directory.
|
NfsCommitResponse |
commit(long offsetToCommit,
int dataSizeToCommit)
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsCreateResponse |
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 |
createNewFile()
Atomically creates a new, empty file named by path if and only if a file
with this name does not yet exist.
|
void |
delete()
Deletes this file/directory.
|
boolean |
exists()
Tests whether this file exists on the NFS server.
|
F |
followLinks() |
F |
followLinks(LinkTracker<N,F> linkTracker) |
NfsFsInfoResponse |
fsinfo()
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsFsStatResponse |
fsstat()
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
java.lang.String |
getAbsolutePath() |
long |
getAccess(long accessToCheck)
Tests whether this client has the specified access permissions for this
file.
|
NfsGetAttrResponse |
getattr()
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsGetAttributes |
getAttributes() |
F |
getChildFile(java.lang.String childName) |
byte[] |
getFileHandle() |
long |
getFreeSpace() |
long |
getMode()
Convenience method to access the protection mode bits, as specified by
RFC 1813 (https://tools.ietf.org/html/rfc1813):
0x00800 - Set user ID on execution.
0x00400 - Set group ID on execution.
0x00200 - Save swapped text (not defined in POSIX).
|
java.lang.String |
getName() |
N |
getNfs() |
java.lang.String |
getParent() |
F |
getParentFile() |
java.lang.String |
getPath() |
long |
getTotalSpace() |
long |
getUsableSpace() |
boolean |
isDirectory() |
boolean |
isFile() |
boolean |
isRootFile() |
long |
lastModified() |
long |
length() |
long |
lengthEx() |
NfsLinkResponse |
link(F source)
Makes the RPC call for these files, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
java.util.List<java.lang.String> |
list()
Lists all files in this directory.
|
java.util.List<java.lang.String> |
list(NfsFilenameFilter filter)
Lists all files matching the filter in this directory.
|
java.util.List<F> |
listFiles()
Lists all files in this directory.
|
java.util.List<F> |
listFiles(NfsFileFilter filter)
Lists all files matching the filter in this directory.
|
java.util.List<F> |
listFiles(NfsFilenameFilter filter)
Lists all files matching the filter in this directory.
|
NfsLookupResponse |
lookup()
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsAccessRequest |
makeAccessRequest(long accessToCheck)
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsCommitRequest |
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).
|
NfsCreateRequest |
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).
|
NfsFsInfoRequest |
makeFsInfoRequest()
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsFsStatRequest |
makeFsStatRequest()
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsGetAttrRequest |
makeGetAttrRequest()
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsLinkRequest |
makeLinkRequest(F source)
Convenience method for creating the request for these files, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsLookupRequest |
makeLookupRequest()
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsMkdirRequest |
makeMkdirRequest(NfsSetAttributes attributes)
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsMknodRequest |
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).
|
NfsPathconfRequest |
makePathconfRequest()
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsReaddirplusRequest |
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).
|
NfsReaddirRequest |
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).
|
NfsReadlinkRequest |
makeReadlinkRequest()
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsReadRequest |
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).
|
NfsRemoveRequest |
makeRemoveRequest()
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsRenameRequest |
makeRenameRequest(F toFile)
Convenience method for creating the request for these files, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsRmdirRequest |
makeRmdirRequest()
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsSetAttrRequest |
makeSetAttrRequest(NfsSetAttributes attributes,
NfsTime guardTime)
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsSymlinkRequest |
makeSymlinkRequest(java.lang.String symbolicLinkData,
NfsSetAttributes attributes)
Convenience method for creating the request for this file, as specified
by RFC 1813 (https://tools.ietf.org/html/rfc1813).
|
NfsWriteRequest |
makeWriteRequest(long offset,
java.util.List<java.nio.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 |
mkdir()
Creates the directory if it does not exist.
|
NfsMkdirResponse |
mkdir(NfsSetAttributes attributes)
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
void |
mkdirs()
Creates the directory and all parent directories if they do not already
exist.
|
NfsMknodResponse |
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).
|
F |
newChildFile(java.lang.String childName)
Creates a new file with the current file as its parent directory.
|
NfsPathconfResponse |
pathconf()
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsReadResponse |
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).
|
NfsReaddirResponse |
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).
|
NfsReaddirResponse |
readdir(long cookie,
long cookieverf,
int count,
java.util.List<NfsDirectoryEntry> entries)
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsReaddirplusResponse |
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).
|
NfsReaddirplusResponse |
readdirplus(long cookie,
long cookieverf,
int dircount,
int maxcount,
java.util.List<NfsDirectoryPlusEntry> entries)
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsReadlinkResponse |
readlink()
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsRemoveResponse |
remove()
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsRenameResponse |
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.
|
NfsRmdirResponse |
rmdir()
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsSetAttrResponse |
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).
|
NfsSymlinkResponse |
symlink(java.lang.String symbolicLinkData,
NfsSetAttributes attributes)
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsWriteResponse |
write(long offset,
java.util.List<java.nio.ByteBuffer> payload,
int syncType)
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
NfsWriteResponse |
write(long offset,
java.util.List<java.nio.ByteBuffer> payload,
int syncType,
java.lang.Long verifier)
Makes the RPC call for this file, as specified by RFC 1813
(https://tools.ietf.org/html/rfc1813).
|
static final char separatorChar
separatorChar.static final java.lang.String separator
separator.static final long setUserIdOnExecuteModeBit
static final long setGroupIdOnExecuteModeBit
static final long saveSwappedTextModeBit
static final long ownerReadModeBit
static final long ownerWriteModeBit
static final long ownerExecuteModeBit
static final long groupReadModeBit
static final long groupWriteModeBit
static final long groupExecuteModeBit
static final long othersReadModeBit
static final long othersWriteModeBit
static final long othersExecuteModeBit
boolean canDelete()
throws java.io.IOException
true if it can, false if it cannotjava.io.IOException - if it does not exist or permissions cannot be read.boolean canExecute()
throws java.io.IOException
true if it can, false if it cannotjava.io.IOException - if it does not exist or permissions cannot be read.boolean canExtend()
throws java.io.IOException
true if it can, false if it cannotjava.io.IOException - if it does not exist or permissions cannot be read.boolean canLookup()
throws java.io.IOException
true if it can, false if it cannotjava.io.IOException - if it does not exist or permissions cannot be read.boolean canModify()
throws java.io.IOException
true if it can, false if it cannotjava.io.IOException - if it does not exist or permissions cannot be read.boolean canRead()
throws java.io.IOException
true if it can, false if it cannotjava.io.IOException - if it does not exist or permissions cannot be read.boolean createNewFile()
throws java.io.IOException
true if the named file did not exist and was
successfully created; false if the named file
already existed.java.io.IOException - If an I/O error occurredvoid delete()
throws java.io.IOException
java.io.IOExceptionboolean exists()
throws java.io.IOException
true if the file exists on the NFS serverjava.io.IOExceptionF followLinks() throws java.io.IOException
java.io.IOExceptionF followLinks(LinkTracker<N,F> linkTracker) throws java.io.IOException
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.java.io.IOExceptionjava.lang.String getAbsolutePath()
server:exported_folders/path_from_exported_filesystem_rootlong getAccess(long accessToCheck)
throws java.io.IOException
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.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).
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).
java.io.IOException - if it does not exist or permissions cannot be read.NfsGetAttributes getAttributes() throws java.io.IOException
java.io.IOExceptionF getChildFile(java.lang.String childName) throws java.io.IOException
childName - java.io.IOExceptionlong getFreeSpace()
throws java.io.IOException
java.io.IOExceptionlong getMode()
throws java.io.IOException
java.io.IOExceptionjava.lang.String getName()
java.lang.String getParent()
F getParentFile()
java.lang.String getPath()
long getTotalSpace()
throws java.io.IOException
java.io.IOExceptionlong getUsableSpace()
throws java.io.IOException
java.io.IOExceptionboolean isDirectory()
throws java.io.IOException
java.io.IOExceptionboolean isFile()
throws java.io.IOException
java.io.IOExceptionboolean isRootFile()
throws java.io.IOException
java.io.IOExceptionlong lastModified()
throws java.io.IOException
java.io.IOExceptionlong length()
long lengthEx()
throws java.io.IOException
java.io.IOException - if the file does not exist or the attributes cannot be read.java.util.List<java.lang.String> list()
throws java.io.IOException
java.io.IOExceptionjava.util.List<java.lang.String> list(NfsFilenameFilter filter) throws java.io.IOException
filter - java.io.IOExceptionjava.util.List<F> listFiles() throws java.io.IOException
java.io.IOExceptionjava.util.List<F> listFiles(NfsFilenameFilter filter) throws java.io.IOException
filter - java.io.IOExceptionjava.util.List<F> listFiles(NfsFileFilter filter) throws java.io.IOException
filter - java.io.IOExceptionvoid mkdir()
throws java.io.IOException
java.io.IOException - if the parent directories do not exist or it cannot be
createdvoid mkdirs()
throws java.io.IOException
java.io.IOException - if it cannot create one of the directories.F newChildFile(java.lang.String childName) throws java.io.IOException
childName - java.io.IOExceptionboolean renameTo(F destination) throws java.io.IOException
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.
destination - java.io.IOExceptionvoid setAttributes(NfsSetAttributes nfsSetAttributes) throws java.io.IOException
nfsSetAttributes - java.io.IOExceptionvoid setLastModified(long millis)
throws java.io.IOException
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.
millis - - The new last-modified time, measured in milliseconds since
the epoch (00:00:00 GMT, January 1, 1970)java.io.IOExceptionvoid setMode(long mode)
throws java.io.IOException
java.io.File methods setExecutable,
setReadable, and setWritable. The protection
mode bits are defined as follows:
mode - the protection mode bitsjava.io.IOExceptionN getNfs()
byte[] getFileHandle()
throws java.io.IOException
java.io.IOExceptionNfsGetAttrResponse getattr() throws java.io.IOException
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).
java.io.IOExceptionNfsGetAttrRequest makeGetAttrRequest() throws java.io.IOException
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).
java.io.IOExceptionNfsSetAttrResponse setattr(NfsSetAttributes attributes, NfsTime guardTime) throws java.io.IOException
Procedure SETATTR changes one or more of the attributes of a file system object on the server.
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.java.io.IOExceptionNfsSetAttrRequest makeSetAttrRequest(NfsSetAttributes attributes, NfsTime guardTime) throws java.io.IOException
Procedure SETATTR changes one or more of the attributes of a file system object on the server.
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.java.io.IOExceptionNfsLookupResponse lookup() throws java.io.IOException
Procedure LOOKUP searches a directory for a specific name and returns the file handle for the corresponding file system object.
java.io.IOExceptionNfsLookupRequest makeLookupRequest() throws java.io.IOException
Procedure LOOKUP searches a directory for a specific name and returns the file handle for the corresponding file system object.
java.io.IOExceptionNfsAccessResponse access(long accessToCheck) throws java.io.IOException
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.
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).
java.io.IOExceptionNfsAccessRequest makeAccessRequest(long accessToCheck) throws java.io.IOException
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.
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).
java.io.IOExceptionNfsReadlinkResponse readlink() throws java.io.IOException
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.
java.io.IOExceptionNfsReadlinkRequest makeReadlinkRequest() throws java.io.IOException
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.
java.io.IOExceptionNfsReadResponse read(long offset, int size, byte[] bytes, int position) throws java.io.IOException
Procedure READ reads data from a file.
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 nulljava.io.IOExceptionNfsReadRequest makeReadRequest(long offset, int size) throws java.io.IOException
Procedure READ reads data from a file.
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.java.io.IOExceptionNfsWriteResponse write(long offset, java.util.List<java.nio.ByteBuffer> payload, int syncType) throws java.io.IOException
Procedure WRITE writes data to a file.
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.
java.io.IOExceptionNfsWriteResponse write(long offset, java.util.List<java.nio.ByteBuffer> payload, int syncType, java.lang.Long verifier) throws java.io.IOException
Procedure WRITE writes data to a file.
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.
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.java.io.IOExceptionNfsWriteRequest makeWriteRequest(long offset, java.util.List<java.nio.ByteBuffer> payload, int syncType) throws java.io.IOException
Procedure WRITE writes data to a file.
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.
java.io.IOExceptionNfsCreateResponse create(NfsCreateMode createMode, NfsSetAttributes attributes, byte[] verifier) throws java.io.IOException
Procedure CREATE creates a regular file.
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.java.io.IOExceptionNfsCreateRequest makeCreateRequest(NfsCreateMode createMode, NfsSetAttributes attributes, byte[] verifier) throws java.io.IOException
Procedure CREATE creates a regular file.
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.java.io.IOExceptionNfsMkdirResponse mkdir(NfsSetAttributes attributes) throws java.io.IOException
Procedure MKDIR creates a new subdirectory.
attributes - The initial attributes for the subdirectory.java.io.IOExceptionNfsMkdirRequest makeMkdirRequest(NfsSetAttributes attributes) throws java.io.IOException
Procedure MKDIR creates a new subdirectory.
attributes - The initial attributes for the subdirectory.java.io.IOExceptionNfsSymlinkResponse symlink(java.lang.String symbolicLinkData, NfsSetAttributes attributes) throws java.io.IOException
Procedure SYMLINK creates a new symbolic link.
symbolicLinkData - The string containing the symbolic link data.attributes - The initial attributes for the symbolic link.java.io.IOExceptionNfsSymlinkRequest makeSymlinkRequest(java.lang.String symbolicLinkData, NfsSetAttributes attributes) throws java.io.IOException
Procedure SYMLINK creates a new symbolic link.
symbolicLinkData - The string containing the symbolic link data.attributes - The initial attributes for the symbolic link.java.io.IOExceptionNfsMknodResponse mknod(NfsType type, NfsSetAttributes attributes, long[] rdev) throws java.io.IOException
Procedure MKNOD creates a new special file of the type, type
. Special files can be device files or named pipes.
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.java.io.IOExceptionNfsMknodRequest makeMknodRequest(NfsType type, NfsSetAttributes attributes, long[] rdev) throws java.io.IOException
Procedure MKNOD creates a new special file of the type, type
. Special files can be device files or named pipes.
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.java.io.IOExceptionNfsRemoveResponse remove() throws java.io.IOException
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.
java.io.IOExceptionNfsRemoveRequest makeRemoveRequest() throws java.io.IOException
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.
java.io.IOExceptionNfsRmdirResponse rmdir() throws java.io.IOException
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.
java.io.IOExceptionNfsRmdirRequest makeRmdirRequest() throws java.io.IOException
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.
java.io.IOExceptionNfsRenameResponse rename(F toFile) throws java.io.IOException
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.
toFile - A file object with the new path for this object.java.io.IOExceptionNfsRenameRequest makeRenameRequest(F toFile) throws java.io.IOException
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.
toFile - A file object with the new path for this object.java.io.IOExceptionNfsLinkResponse link(F source) throws java.io.IOException
Procedure LINK creates a hard link from source to this file.
This file and source must reside on the same file system and
server.
source - The existing file system object to which this file should be
linked.java.io.IOExceptionNfsLinkRequest makeLinkRequest(F source) throws java.io.IOException
Procedure LINK creates a hard link from source to this file.
This file and source must reside on the same file system and
server.
source - The existing file system object to which this file should be
linked.java.io.IOExceptionNfsReaddirResponse readdir(long cookie, long cookieverf, int count) throws java.io.IOException
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.
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.java.io.IOExceptionNfsReaddirResponse readdir(long cookie, long cookieverf, int count, java.util.List<NfsDirectoryEntry> entries) throws java.io.IOException
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.
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.java.io.IOExceptionNfsReaddirRequest makeReaddirRequest(long cookie, long cookieverf, int count) throws java.io.IOException
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.
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.java.io.IOExceptionNfsReaddirplusResponse readdirplus(long cookie, long cookieverf, int dircount, int maxcount) throws java.io.IOException
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.
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.java.io.IOExceptionNfsReaddirplusResponse readdirplus(long cookie, long cookieverf, int dircount, int maxcount, java.util.List<NfsDirectoryPlusEntry> entries) throws java.io.IOException
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.
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.java.io.IOExceptionNfsReaddirplusRequest makeReaddirplusRequest(long cookie, long cookieverf, int dircount, int maxcount) throws java.io.IOException
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.
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.java.io.IOExceptionNfsFsStatResponse fsstat() throws java.io.IOException
Procedure FSSTAT retrieves volatile file system state information.
java.io.IOExceptionNfsFsStatRequest makeFsStatRequest() throws java.io.IOException
Procedure FSSTAT retrieves volatile file system state information.
java.io.IOExceptionNfsFsInfoResponse fsinfo() throws java.io.IOException
Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation.
java.io.IOExceptionNfsFsInfoRequest makeFsInfoRequest() throws java.io.IOException
Procedure FSINFO retrieves nonvolatile file system state information and general information about the NFS version 3 protocol server implementation.
java.io.IOExceptionNfsPathconfResponse pathconf() throws java.io.IOException
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.
java.io.IOExceptionNfsPathconfRequest makePathconfRequest() throws java.io.IOException
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.
java.io.IOExceptionNfsCommitResponse commit(long offsetToCommit, int dataSizeToCommit) throws java.io.IOException
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.
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.java.io.IOExceptionNfsCommitRequest makeCommitRequest(long offsetToCommit, int dataSizeToCommit) throws java.io.IOException
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.
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.java.io.IOException