|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.Prominic.jFTPd.VirtualFile
class VirtualFile
This class does the conversion between a virtual file and its corresponding file on disk. As the user sees virtual directories so the FTP commands are based on virtual paths, these paths need to be converted to actual directories for download/uploads to happen. Also, virtual parent directories need to be also computed.
Field Summary | |
---|---|
private java.io.File |
file
|
private boolean |
isWindows
|
private java.lang.String |
realPath
|
static java.lang.String |
root
|
private java.util.Hashtable |
virtualDirs
|
private java.lang.String |
virtualPath
|
Constructor Summary | |
---|---|
VirtualFile(java.lang.String virtualPath,
java.util.Hashtable virtualDirs)
Constructs a virtual file, based on the virtual path and the list of virtual directories representing the client's home directories. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Checks if two virtual paths are identical. |
boolean |
exists()
Checks if a virtual path exists on disk. |
java.io.File |
getFileMember()
Obtains a File object representing the real file on disk. |
java.lang.String |
getParent()
Returns a virtual parent for this object. |
protected java.lang.String |
getRealPath()
Returns the real path corresponding to a virtual path. |
protected java.lang.String |
getVirtualPath()
|
boolean |
inVirtualRoot()
Checks if the virtual path is the virtual home directory (virtual root) |
boolean |
isDirectory()
Checks if a virtual path represents a directory on disk. |
long |
lastModified()
Checks when's the last modified time for a virtual path (in fact the last modified time for actual file represented by the virtual path). |
long |
length()
|
java.lang.String[] |
list()
Composes the virtual root directory contents (where links to each home directories will be found). |
java.lang.String[] |
list(WildcardFilter filter)
Gets a file list based on the given filter. |
java.lang.String |
replaceSlash(java.lang.String oldPath)
Path fixups. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Hashtable virtualDirs
private java.io.File file
private java.lang.String virtualPath
private java.lang.String realPath
private boolean isWindows
public static java.lang.String root
Constructor Detail |
---|
public VirtualFile(java.lang.String virtualPath, java.util.Hashtable virtualDirs)
virtualPath
- - virtual pathvirtualDirs
- - virtual home directories.Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- - some virtual path.
public boolean exists()
public java.io.File getFileMember()
public java.lang.String getParent()
protected java.lang.String getRealPath()
protected java.lang.String getVirtualPath()
public boolean inVirtualRoot()
public boolean isDirectory()
public long lastModified()
public long length()
public java.lang.String[] list()
public java.lang.String[] list(WildcardFilter filter)
filter
- - filter
public java.lang.String replaceSlash(java.lang.String oldPath)
oldPath
- - path to be replaces
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |