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