public abstract class BaseOverthereFile<C extends BaseOverthereConnection> extends java.lang.Object implements OverthereFile
OverthereConnection
.Modifier and Type | Field and Description |
---|---|
protected C |
connection |
Modifier | Constructor and Description |
---|---|
protected |
BaseOverthereFile() |
protected |
BaseOverthereFile(C connection) |
Modifier and Type | Method and Description |
---|---|
protected void |
copyFrom(OverthereFile source) |
void |
copyTo(OverthereFile dest)
Copies this file or directory (recursively) to the destination.
|
void |
deleteRecursively()
Deletes this file or directory.
|
C |
getConnection()
Return the connection through which this file is accessible.
|
OverthereFile |
getFile(java.lang.String child)
Returns a reference to a named child of this file or
null if this file is not a directory. |
protected void |
localCopyFrom(OverthereFile source)
Copies this file or directory (recursively) to a (new) destination in the same connection.
|
abstract java.lang.String |
toString()
Subclasses MUST implement toString properly.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canExecute, canRead, canWrite, delete, exists, getInputStream, getName, getOutputStream, getParentFile, getPath, isDirectory, isFile, isHidden, lastModified, length, listFiles, mkdir, mkdirs, renameTo, setExecutable
protected C extends BaseOverthereConnection connection
protected BaseOverthereFile()
protected BaseOverthereFile(C connection)
public C getConnection()
OverthereFile
getConnection
in interface OverthereFile
public OverthereFile getFile(java.lang.String child)
OverthereFile
null
if this file is not a directory. The child
file returned may or may not exist.getFile
in interface OverthereFile
child
- the name of the child relative to this file. May not contain path separators.null
if this file is not a directory.public void deleteRecursively() throws RuntimeIOException
OverthereFile
deleteRecursively
in interface OverthereFile
RuntimeIOException
public final void copyTo(OverthereFile dest)
OverthereFile
OverthereFile.renameTo(OverthereFile)
, a file can be copied accross connections
and across file systems withtin a connection
.copyTo
in interface OverthereFile
dest
- the file to copy to.protected void copyFrom(OverthereFile source)
protected void localCopyFrom(OverthereFile source)
source
- The source file or directorypublic abstract java.lang.String toString()
toString
in class java.lang.Object