|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.nfs.XFileAccessor
The XFileAccessor interface is implemented by filesystems that need to be accessed via the XFile API.
XFile
Constructor Summary | |
XFileAccessor()
|
Method Summary | |
boolean |
canRead()
Tests if the application can read from the specified file. |
boolean |
canWrite()
Tests if the application can write to this file. |
void |
close()
Close the file Since NFS has no concept of file close, we just flush any buffered data. |
boolean |
delete()
Deletes the file specified by this object. |
boolean |
exists()
Tests if this XFileAccessor object exists. |
void |
flush()
Forces any buffered output bytes to be written out. |
XFile |
getXFile()
|
boolean |
isDirectory()
Tests if the file represented by this XFileAccessor object is a directory. |
boolean |
isFile()
Tests if the file represented by this object is a "normal" nfs. |
long |
lastModified()
Returns the time that the file represented by this XFile object was last modified. |
long |
length()
Returns the length of the file represented by this XFileAccessor object. |
java.lang.String[] |
list()
Returns a list of the files in the directory specified by this XFileAccessor object. |
boolean |
mkdir()
Creates a directory whose pathname is specified by this XFileAccessor object. |
boolean |
mkfile()
Creates a file whose pathname is specified by this XFileAccessor object. |
boolean |
open(XFile xf,
boolean serial,
boolean readOnly)
Open this NFS object |
int |
read(byte[] b,
int off,
int len,
long foff)
Reads a subarray as a sequence of bytes. |
boolean |
renameTo(XFile dest)
Renames the file specified by this XFileAccessor object to have the pathname given by the XFileAccessor object argument. |
java.lang.String |
toString()
Returns a string representation of this object. |
void |
write(byte[] b,
int off,
int len,
long foff)
Writes a sub array as a sequence of bytes. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public XFileAccessor()
Method Detail |
public boolean open(XFile xf, boolean serial, boolean readOnly)
xf
- the XFile objectserial
- true if serial accessreadOnly
- true if read onlypublic XFile getXFile()
public boolean exists()
true
if the file specified by this object
exists; false
otherwise.public boolean canWrite()
true
if the application is allowed to
write to a file whose name is specified by this
object; false
otherwise.public boolean canRead()
true
if the file specified by this
object exists and the application can read the file;
false
otherwise.public boolean isFile()
A file is "normal" if it is not a directory and, in addition, satisfies other system-dependent criteria. Any non-directory file created by a Java application is guaranteed to be a normal nfs.
true
if the file specified by this
XFile
object exists and is a "normal"
file; false
otherwise.public boolean isDirectory()
true
if this XFileAccessor object
exists and is a directory; false
otherwise.public long lastModified()
XFile
object was last modified.
The return value is system dependent and should only be used to compare with other values returned by last modified. It should not be interpreted as an absolute time.
0L
if the specified file
does not exist.public long length()
0L
if the specified
file does not exist.public boolean mkfile()
true
if the file could be created;
false
otherwise.public boolean mkdir()
true
if the directory could be created;
false
otherwise.public boolean renameTo(XFile dest)
dest
- the new filename.true
if the renaming succeeds;
false
otherwise.public java.lang.String[] list()
.
" and
"..
" on Unix systems).public boolean delete()
true
if the file is successfully deleted;
false
otherwise.public int read(byte[] b, int off, int len, long foff) throws java.io.IOException
b
- the data to be writtenoff
- the start offset in the datalen
- the number of bytes that are writtenfoff
- the offset into the filepublic void write(byte[] b, int off, int len, long foff) throws java.io.IOException
b
- the data to be writtenoff
- the start offset in the datalen
- the number of bytes that are writtenfoff
- the offset into the filepublic void flush() throws java.io.IOException
public void close() throws java.io.IOException
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |