public final class LocalFile extends File implements CoFile
Only absolute pathnames are supported!
CoFile
,
File
,
Serialized FormModifier and Type | Field and Description |
---|---|
private String |
ext |
private String |
name |
pathSeparator, pathSeparatorChar, separator, separatorChar
Constructor and Description |
---|
LocalFile(LocalFile dir,
String name)
Creates a new LocalFile instance from a parent
abstract pathname and a child pathname string.
|
LocalFile(String path)
Creates a new LocalFile instance by converting the
given pathname string into an abstract pathname.
|
LocalFile(String path,
String name)
Creates a new LocalFile instance from a parent
pathname string and a child pathname string.
|
Modifier and Type | Method and Description |
---|---|
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(Object o)
Compares two abstract pathnames lexicographically (by pathname).
|
boolean |
delete()
Deletes the file or directory denoted by this abstract pathname.
|
boolean |
equals(Object o) |
boolean |
equalsExtTo(String filter)
Tests this abstract pathname for equality with the given extension.
|
boolean |
equalsExtTo(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.
|
String |
getAccess()
Returns access string.
|
CoConsole |
getConsole()
Gets console if implemented or null.
|
char |
getDataType()
Get type of data transfer.
|
String |
getHost()
Returns the host name.
|
InputStream |
getInputStream()
Returns an input stream for this file.
|
String |
getName()
Returns the name of the file represented by this object.
|
OutputStream |
getOutputStream()
Returns an output stream for this file.
|
OutputStream |
getOutputStream(boolean append)
Returns an output stream for this file.
|
String |
getParent()
Returns the parent part of the pathname of this File
object, or null if the name has no parent part.
|
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 |
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.
|
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(String child)
Creates a new file instance from this
abstract pathname and a child string.
|
CoFile |
newFileRename(String name)
Creates a new file instance from a parent
of this abstract pathname and a name string.
|
String |
propertyString()
Returns a property string.
|
boolean |
renameTo(CoFile dest)
Renames the file denoted by this abstract pathname.
|
private void |
sortSetup(String name) |
boolean |
startsWithIgnoreCase(char ch)
Tests this abstract pathname whether
name starts with the given character.
|
String |
toString()
Returns a string representation of this object.
|
canExecute, createNewFile, createTempFile, createTempFile, deleteOnExit, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isHidden, list, list, listFiles, listFiles, listFiles, listRoots, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toURI, toURL
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAbsolutePath, isHidden
public LocalFile(String path)
public LocalFile(String path, String name)
public int compareNameToIgnoreCase(CoOrder file)
CoOrder
compareNameToIgnoreCase
in interface CoOrder
public int compareExtToIgnoreCase(CoOrder file)
CoOrder
compareExtToIgnoreCase
in interface CoOrder
public boolean startsWithIgnoreCase(char ch)
CoOrder
startsWithIgnoreCase
in interface CoOrder
public boolean equalsExtTo(String filter)
CoOrder
equalsExtTo
in interface CoOrder
public boolean equalsExtTo(String[] filter)
CoOrder
equalsExtTo
in interface CoOrder
public int compareTo(Object o)
CoOrder
public boolean isConnected()
CoOrder
isConnected
in interface CoOrder
public char getDataType()
CoOpen
getDataType
in interface CoOpen
public InputStream getInputStream() throws IOException
CoOpen
getInputStream
in interface CoOpen
IOException
public OutputStream getOutputStream() throws IOException
CoOpen
getOutputStream
in interface CoOpen
IOException
public OutputStream getOutputStream(boolean append) throws IOException
CoOpen
getOutputStream
in interface CoOpen
IOException
public CoFile newFileChild(String child)
CoOpen
newFileChild
in interface CoOpen
public CoFile newFileRename(String name)
CoOpen
newFileRename
in interface CoOpen
public CoConsole getConsole()
CoOpen
getConsole
in interface CoOpen
public String getHost()
CoFile
public int getPathDepth()
CoFile
getPathDepth
in interface CoFile
public CoFile getPathFragment(int depth)
CoFile
getPathFragment
in interface CoFile
public 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 String getName()
CoFile
public String getParent()
CoFile
public boolean delete() throws SecurityException
CoFile
delete
in interface CoFile
delete
in class File
SecurityException
public boolean mkdir() throws SecurityException
CoFile
mkdir
in interface CoFile
mkdir
in class File
SecurityException
public boolean mkdirs() throws SecurityException
CoFile
mkdirs
in interface CoFile
mkdirs
in class File
SecurityException
public boolean renameTo(CoFile dest) throws SecurityException
CoFile
renameTo
in interface CoFile
SecurityException
public String lastModifiedString()
CoFile
lastModifiedString
in interface CoFile
public long length()
CoFile
public long lastModified()
CoFile
lastModified
in interface CoFile
lastModified
in class File
public boolean isAbsolute()
CoFile
isAbsolute
in interface CoFile
isAbsolute
in class File
public boolean isDirectory()
CoFile
isDirectory
in interface CoFile
isDirectory
in class File
public boolean isFile()
CoFile
public boolean isSpecial()
CoFile
public boolean isLink()
CoFile
public boolean canRead()
CoFile
public boolean canWrite()
CoFile
public boolean exists()
CoFile
public String getAccess()
CoFile
public String propertyString()
CoFile
propertyString
in interface CoFile
public CoFile[] listCoRoots()
CoFile
listCoRoots
in interface CoFile
public CoFile[] listCoFiles() throws SecurityException
CoFile
listCoFiles
in interface CoFile
SecurityException
public CoFile[] listCoFiles(CoFilenameFilter filter) throws SecurityException
CoFile
CoFile.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 CoFile
SecurityException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses