|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.http.XFileAccessor
public class 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 Streams |
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()
Get the XFile for this Accessor |
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" file. |
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 file 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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XFileAccessor()
| Method Detail |
|---|
public boolean open(XFile xf,
boolean serial,
boolean readOnly)
open in interface XFileAccessorxf - the XFile for this fileserial - true if serial accessreadOnly - true if read onlypublic XFile getXFile()
getXFile in interface XFileAccessorpublic boolean exists()
exists in interface XFileAccessortrue if the file specified by this object
exists; false otherwise.public boolean canWrite()
canWrite in interface XFileAccessortrue if the application is allowed to
write to a file whose name is specified by this
object; false otherwise.public boolean canRead()
canRead in interface XFileAccessortrue 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 file.
isFile in interface XFileAccessortrue if the file specified by this
XFile object exists and is a "normal"
file; false otherwise.public boolean isDirectory()
isDirectory in interface XFileAccessortrue 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.
lastModified in interface XFileAccessor0L if the specified file
does not exist.public long length()
length in interface XFileAccessor0L if the specified
file does not exist.public boolean mkfile()
mkfile in interface XFileAccessortrue if the file could be created;
false otherwise.public boolean mkdir()
mkdir in interface XFileAccessortrue if the directory could be created;
false otherwise.public boolean renameTo(XFile dest)
renameTo in interface XFileAccessordest - the new filename.
true if the renaming succeeds;
false otherwise.public java.lang.String[] list()
list in interface XFileAccessor." and
".." on Unix systems).public boolean delete()
delete in interface XFileAccessortrue if the file is successfully deleted;
false otherwise.
public int read(byte[] b,
int off,
int len,
long foff)
throws java.io.IOException
read in interface XFileAccessorb - the data to be writtenoff - the start offset in the datalen - the number of bytes that are writtenfoff - the offset into the file
java.io.IOException - If an I/O error has occurred.
public void write(byte[] b,
int off,
int len,
long foff)
throws java.io.IOException
write in interface XFileAccessorb - the data to be writtenoff - the start offset in the datalen - the number of bytes that are writtenfoff - the offset into the file
java.io.IOException - If an I/O error has occurred.
public void flush()
throws java.io.IOException
flush in interface XFileAccessorjava.io.IOException - if an I/O error occurs.
public void close()
throws java.io.IOException
close in interface XFileAccessorjava.io.IOException - If an I/O error has occurred.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||