Allows uniform manipulation with files from various sources. Equivalent for File object.
Only absolute pathnames are supported!
File
Method Summary | |
boolean |
canRead()
Tests whether the application can read the file denoted by this abstract pathname. |
boolean |
canWrite()
Tests whether the application can modify to the file denoted by this abstract pathname. |
boolean |
delete()
Deletes the file or directory denoted by this abstract pathname. |
boolean |
exists()
Tests whether the file denoted by this abstract pathname exists. |
java.lang.String |
getAbsolutePath()
Returns the absolute pathname of the file represented by this object. |
java.lang.String |
getAccess()
Returns access string. |
java.lang.String |
getHost()
Returns the host name. |
java.lang.String |
getName()
Returns the name of the file represented by this object. |
java.lang.String |
getParent()
Returns the parent part of the pathname of this File object, or null if the name has no parent part. |
java.lang.String[] |
getPathArray()
Tokens the pathname by separator. |
int |
getPathDepth()
Returns depth (number of levels) of this abstract pathname. |
CoFile |
getPathFragment(int depth)
Returns abstract pathname containing first depth levels of this pathname of the file represented by this object. |
boolean |
isAbsolute()
Tests if the file represented by this File object is an absolute pathname. |
boolean |
isDirectory()
Tests if the file represented by this File object is a directory. |
boolean |
isFile()
Tests if the file represented by this File object is a "normal" file. |
boolean |
isHidden()
Tests whether the file named by this abstract pathname is a hidden file. |
boolean |
isLink()
Tests whether the file named by this abstract pathname is a link. |
boolean |
isSpecial()
Tests whether the file named by this abstract pathname is a special file. |
long |
lastModified()
Returns the time that the file represented by this File object was last modified. |
java.lang.String |
lastModifiedString()
Returns the time string that the file represented by this CoFile object was last modified in short mode. |
long |
length()
Returns the length of the file represented by this File object. |
CoFile[] |
listCoFiles()
Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname. |
CoFile[] |
listCoFiles(CoFilenameFilter filter)
Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter. |
CoFile[] |
listCoRoots()
List the available filesystem roots. |
boolean |
mkdir()
Creates the directory named by this abstract pathname. |
boolean |
mkdirs()
Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories. |
java.lang.String |
propertyString()
Returns a property string. |
boolean |
renameTo(CoFile dest)
Renames the file denoted by this abstract pathname. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from interface cz.dhl.io.CoOrder |
compareExtToIgnoreCase, compareNameToIgnoreCase, compareTo, equalsExtTo, equalsExtTo, isConnected, startsWithIgnoreCase |
Methods inherited from interface cz.dhl.io.CoOpen |
getConsole, getDataType, getInputStream, getOutputStream, getOutputStream, newFileChild, newFileRename |
Method Detail |
public boolean canRead()
public boolean canWrite()
public boolean delete() throws java.lang.SecurityException
java.lang.SecurityException
public boolean exists()
public java.lang.String getAbsolutePath()
public java.lang.String getAccess()
public java.lang.String getHost()
public java.lang.String getName()
public java.lang.String getParent()
public java.lang.String[] getPathArray()
[Server-name]/[Disk-root]
[1st-level-parent-dir-name]
[2nd-level-parent-dir-name]
...
[Top-level-parent-dir-name]
public int getPathDepth()
public CoFile getPathFragment(int depth)
public boolean isAbsolute()
public boolean isDirectory()
public boolean isFile()
public boolean isHidden()
public boolean isLink()
public boolean isSpecial()
public long lastModified()
public java.lang.String lastModifiedString()
public long length()
public CoFile[] listCoFiles() throws java.lang.SecurityException
java.lang.SecurityException
public CoFile[] listCoFiles(CoFilenameFilter filter) throws java.lang.SecurityException
listCoFiles()
} method, except that the strings
in the returned array must satisfy the filter. If the given filter
is null then all names are accepted.
java.lang.SecurityException
public CoFile[] listCoRoots()
public boolean mkdir() throws java.lang.SecurityException
java.lang.SecurityException
public boolean mkdirs() throws java.lang.SecurityException
java.lang.SecurityException
public java.lang.String propertyString()
public boolean renameTo(CoFile dest) throws java.lang.SecurityException
java.lang.SecurityException
public java.lang.String toString()