All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class kmy.net.ftpd.VirtualFile

kmy.net.ftpd.VirtualObject
   |
   +----kmy.net.ftpd.VirtualFile

public class VirtualFile
extends VirtualObject
This is an extention of VirtualObject that describes a file on the local filesystem.


Method Index

 o canList()
Check if this object is a readable directory.
 o canRead()
Check if this object is not a folder and can be read.
 o canWrite()
Check if this object is not a folder and can be written.
 o delete()
Request to delete this file
 o getAnnotationReader()
Get annotation for this resource.
 o getMimeType()
Return MIME-type for the content of this object.
 o lastModified()
Return when this object was last modified
 o list(PrintWriter, String, boolean)
produce a list of the subresources in this resource.
 o mkdir()
Creates a folder specified by the path (given in the constructor).
 o read(OutputStream, int, long)
Read this object and write it (as it is being read) to out.
 o renameTo(VirtualObject)
Rename/move this file
 o size()
Return the size of this object in bytes
 o write(InputStream, int, long)
Write this object reading data from the stream.

Methods

 o canList
 public boolean canList()
Check if this object is a readable directory.

Overrides:
canList in class VirtualObject
 o list
 public void list(PrintWriter out,
                  String patt,
                  boolean verbose) throws FTPDException
produce a list of the subresources in this resource.

Parameters:
out - output stream where the list should be printed.
patt - optional pattern that should be used to filter resources.
verbose - if verbose (ls -l) or compact (just name) list should be probuced.
Throws: FTPDException
if this file cannot be listed
Overrides:
list in class VirtualObject
 o canRead
 public boolean canRead()
Check if this object is not a folder and can be read.

Overrides:
canRead in class VirtualObject
 o read
 public void read(OutputStream out,
                  int mode,
                  long offset) throws IOException, FTPDException
Read this object and write it (as it is being read) to out.

Parameters:
out - output stream
mode - transfer mode: FTPConnection.DATA_ASCII or DATA_BIN
offset - offset where to start transfer
Throws: FTPDException
if file cannot be read
Throws: IOException
if reading failed
Overrides:
read in class VirtualObject
 o canWrite
 public boolean canWrite()
Check if this object is not a folder and can be written.

Overrides:
canWrite in class VirtualObject
 o write
 public void write(InputStream in,
                   int mode,
                   long offset) throws IOException, FTPDException
Write this object reading data from the stream.

Parameters:
in - input stream
mode - transfer mode: FTPConnection.DATA_ASCII or DATA_BIN
offset - offset where to start writing data
Throws: FTPDException
if file cannot be written
Throws: IOException
if writing failed
Overrides:
write in class VirtualObject
 o getAnnotationReader
 public Reader getAnnotationReader()
Get annotation for this resource. Annotations exist only for folders and are taken from the file ".annot" in the folder

Overrides:
getAnnotationReader in class VirtualObject
 o size
 public long size() throws FTPDException
Return the size of this object in bytes

Throws: FTPDException
if size is unknown
Overrides:
size in class VirtualObject
 o lastModified
 public long lastModified() throws FTPDException
Return when this object was last modified

Throws: FTPDException
if modification time is unknown
Overrides:
lastModified in class VirtualObject
 o getMimeType
 public String getMimeType()
Return MIME-type for the content of this object. This information can be accessed using SITE MIME command.

Overrides:
getMimeType in class VirtualObject
 o mkdir
 public void mkdir() throws FTPDException
Creates a folder specified by the path (given in the constructor).

Throws: FTPDException
throws an exception if this folder cannot be created
Overrides:
mkdir in class VirtualObject
 o delete
 public void delete() throws FTPDException
Request to delete this file

Throws: FTPDException
throws an exception if file cannot be deleted
Overrides:
delete in class VirtualObject
 o renameTo
 public void renameTo(VirtualObject dest) throws FTPDException
Rename/move this file

Throws: FTPDException
throws an exception if file cannot be move to the path requested
Overrides:
renameTo in class VirtualObject

All Packages  Class Hierarchy  This Package  Previous  Next  Index