java.lang.Objectjava.io.File
cz.dhl.io.LocalFile
Allows uniform manipulation with local files. Equivalent for File object.
Only absolute pathnames are supported!
CoFile,
File,
Serialized Form| Field Summary |
| Fields inherited from class java.io.File |
pathSeparator, pathSeparatorChar, separator, separatorChar |
| Constructor Summary | |
LocalFile(LocalFile dir,
java.lang.String name)
Creates a new LocalFile instance from a parent abstract pathname and a child pathname string. |
|
LocalFile(java.lang.String path)
Creates a new LocalFile instance by converting the given pathname string into an abstract pathname. |
|
LocalFile(java.lang.String path,
java.lang.String name)
Creates a new LocalFile instance from a parent pathname string and a child pathname string. |
|
| 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. |
int |
compareExtToIgnoreCase(CoOrder file)
Compares two abstract pathnames lexicographically by extension. |
int |
compareNameToIgnoreCase(CoOrder file)
Compares two abstract pathnames lexicographically by name. |
int |
compareTo(java.lang.Object o)
Compares two abstract pathnames lexicographically (by pathname). |
boolean |
delete()
Deletes the file or directory denoted by this abstract pathname. |
boolean |
equals(java.lang.Object o)
|
boolean |
equalsExtTo(java.lang.String filter)
Tests this abstract pathname for equality with the given extension. |
boolean |
equalsExtTo(java.lang.String[] filter)
Tests this abstract pathname for equality with one of the given extensions. |
boolean |
exists()
Tests whether the file denoted by this abstract pathname exists. |
java.lang.String |
getAccess()
Returns access string. |
CoConsole |
getConsole()
Gets console if implemented or null. |
char |
getDataType()
Get type of data transfer. |
java.lang.String |
getHost()
Returns the host name. |
java.io.InputStream |
getInputStream()
Returns an input stream for this file. |
java.lang.String |
getName()
Returns the name of the file represented by this object. |
java.io.OutputStream |
getOutputStream()
Returns an output stream for this file. |
java.io.OutputStream |
getOutputStream(boolean append)
Returns an output stream for this file. |
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 |
isConnected()
Tests if corresponding connection to remote host is active. |
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. |
CoFile |
newFileChild(java.lang.String child)
Creates a new file instance from this abstract pathname and a child string. |
CoFile |
newFileRename(java.lang.String name)
Creates a new file instance from a parent of this abstract pathname and a name string. |
java.lang.String |
propertyString()
Returns a property string. |
boolean |
renameTo(CoFile dest)
Renames the file denoted by this abstract pathname. |
boolean |
startsWithIgnoreCase(char ch)
Tests this abstract pathname whether name starts with the given character. |
java.lang.String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.io.File |
compareTo, createNewFile, createTempFile, createTempFile, deleteOnExit, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getParentFile, getPath, hashCode, list, list, listFiles, listFiles, listFiles, listRoots, renameTo, setLastModified, setReadOnly, toURI, toURL |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface cz.dhl.io.CoFile |
getAbsolutePath |
| Constructor Detail |
public LocalFile(LocalFile dir,
java.lang.String name)
public LocalFile(java.lang.String path)
public LocalFile(java.lang.String path,
java.lang.String name)
| Method Detail |
public boolean canRead()
CoFile
canRead in interface CoFilepublic boolean canWrite()
CoFile
canWrite in interface CoFilepublic int compareExtToIgnoreCase(CoOrder file)
CoOrder
compareExtToIgnoreCase in interface CoOrderpublic int compareNameToIgnoreCase(CoOrder file)
CoOrder
compareNameToIgnoreCase in interface CoOrderpublic int compareTo(java.lang.Object o)
CoOrder
compareTo in interface CoOrder
public boolean delete()
throws java.lang.SecurityException
CoFile
delete in interface CoFilejava.lang.SecurityExceptionpublic boolean equals(java.lang.Object o)
public boolean equalsExtTo(java.lang.String filter)
CoOrder
equalsExtTo in interface CoOrderfilter - must be uppercase string with a leading '.' sign;
example: ".TXT" or ".HTM" or ".HTML" etc ...public boolean equalsExtTo(java.lang.String[] filter)
CoOrder
equalsExtTo in interface CoOrderfilter - must be array of uppercase strings with a leading '.' sign;
example: { ".TXT", ".HTM", ".HTML", etc ... }public boolean exists()
CoFile
exists in interface CoFilepublic java.lang.String getAccess()
CoFile
getAccess in interface CoFilepublic CoConsole getConsole()
CoOpen
getConsole in interface CoOpenpublic char getDataType()
CoOpen
getDataType in interface CoOpenpublic java.lang.String getHost()
CoFile
getHost in interface CoFile
public java.io.InputStream getInputStream()
throws java.io.IOException
CoOpen
getInputStream in interface CoOpenjava.io.IOExceptionpublic java.lang.String getName()
CoFile
getName in interface CoFile
public java.io.OutputStream getOutputStream()
throws java.io.IOException
CoOpen
getOutputStream in interface CoOpenjava.io.IOException
public java.io.OutputStream getOutputStream(boolean append)
throws java.io.IOException
CoOpen
getOutputStream in interface CoOpenjava.io.IOExceptionpublic java.lang.String getParent()
CoFile
getParent in interface CoFilepublic java.lang.String[] getPathArray()
CoFile
getPathArray in interface CoFile[Server-name]/[Disk-root]
[1st-level-parent-dir-name]
[2nd-level-parent-dir-name]
...
[Top-level-parent-dir-name]public int getPathDepth()
CoFile
getPathDepth in interface CoFilepublic CoFile getPathFragment(int depth)
CoFile
getPathFragment in interface CoFilepublic boolean isAbsolute()
CoFile
isAbsolute in interface CoFilepublic boolean isConnected()
CoOrder
isConnected in interface CoOrderpublic boolean isDirectory()
CoFile
isDirectory in interface CoFilepublic boolean isFile()
CoFile
isFile in interface CoFilepublic boolean isHidden()
CoFile
isHidden in interface CoFilepublic boolean isLink()
CoFile
isLink in interface CoFilepublic boolean isSpecial()
CoFile
isSpecial in interface CoFilepublic long lastModified()
CoFile
lastModified in interface CoFilepublic java.lang.String lastModifiedString()
CoFile
lastModifiedString in interface CoFilepublic long length()
CoFile
length in interface CoFile
public CoFile[] listCoFiles()
throws java.lang.SecurityException
CoFile
listCoFiles in interface CoFilejava.lang.SecurityException
public CoFile[] listCoFiles(CoFilenameFilter filter)
throws java.lang.SecurityException
CoFileCoFile.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.
listCoFiles in interface CoFilejava.lang.SecurityExceptionpublic CoFile[] listCoRoots()
CoFile
listCoRoots in interface CoFile
public boolean mkdir()
throws java.lang.SecurityException
CoFile
mkdir in interface CoFilejava.lang.SecurityException
public boolean mkdirs()
throws java.lang.SecurityException
CoFile
mkdirs in interface CoFilejava.lang.SecurityExceptionpublic CoFile newFileChild(java.lang.String child)
CoOpen
newFileChild in interface CoOpenpublic CoFile newFileRename(java.lang.String name)
CoOpen
newFileRename in interface CoOpenpublic java.lang.String propertyString()
CoFile
propertyString in interface CoFile
public boolean renameTo(CoFile dest)
throws java.lang.SecurityException
CoFile
renameTo in interface CoFilejava.lang.SecurityExceptionpublic boolean startsWithIgnoreCase(char ch)
CoOrder
startsWithIgnoreCase in interface CoOrderpublic java.lang.String toString()
CoFile
toString in interface CoFile