|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.File
de.goerntkai.toolbox.fs.File
de.goerntkai.toolbox.fs.Folder
Represents a folder object in the file system. The base
de.goerntkai.devbase.tools.File
is extended with
hasSubdirectories
, deleteContents
and
deleteWithContents
. The copyTo
which copies the
folder to the given destination is overwritten.
File
,
Serialized FormField Summary |
Fields inherited from class de.goerntkai.toolbox.fs.File |
SUFFIX_SEPERATOR |
Fields inherited from class java.io.File |
pathSeparator, pathSeparatorChar, separator, separatorChar |
Constructor Summary | |
Folder(java.io.File theFile)
Creates a new Folder from an object of its
superclass. |
|
Folder(File theParent,
java.lang.String theChild)
Inherited from de.goerntkai.devbase.tools.File . |
|
Folder(java.lang.String thePathname)
Inherited from de.goerntkai.devbase.tools.File . |
|
Folder(java.lang.String theParent,
java.lang.String theChild)
Inherited from de.goerntkai.devbase.tools.File . |
|
Folder(java.net.URI theURI)
Inherited from de.goerntkai.devbase.tools.File . |
Method Summary | |
long |
copyTo(java.io.File destination)
Copies this folder object to the given destination folder. |
long |
copyTo(Folder destination)
Copies this folder object to the given destination file. |
boolean |
deleteContents()
Deletes the folder and recursively all its subdirectories. |
boolean |
deleteWithContents()
Deletes recursively all the subdirectories, the contending files and at last the folder itself. |
boolean |
hasSubdirectories()
Returns true when there is at least one subdirectory or
false if there is none. |
java.io.File[] |
listFiles()
Inherited from java.io.File . |
Methods inherited from class de.goerntkai.toolbox.fs.File |
copyTo, copyTo, getBareName, getSuffix |
Methods inherited from class java.io.File |
canRead, canWrite, compareTo, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Folder(File theParent, java.lang.String theChild)
Inherited from de.goerntkai.devbase.tools.File
.
theParent
- to create the child intheChild
- to createFile
public Folder(java.io.File theFile) throws NoFolderException
Creates a new Folder
from an object of its
superclass.
theFile
- to create
NoFolderException
- when myself
is no directorypublic Folder(java.lang.String thePathname) throws NoFolderException
Inherited from de.goerntkai.devbase.tools.File
.
thePathname
- of the file
NoFolderException
- when pathname
is no directoryFile
public Folder(java.lang.String theParent, java.lang.String theChild)
Inherited from de.goerntkai.devbase.tools.File
.
theParent
- to create the child intheChild
- to createFile
public Folder(java.net.URI theURI)
Inherited from de.goerntkai.devbase.tools.File
.
theURI
- of the fileFile
Method Detail |
public final long copyTo(Folder destination) throws java.io.IOException
Copies this folder object to the given destination file. Copies
files as well as directories recursively. Returns the number of bytes
that were copied. Returns -1
if the source was no folder or
does not exist.
destination
- where to copy the folder to
java.io.IOException
- on problems with the streamsFile.copyTo(java.lang.String)
,
copyTo(Folder)
public final long copyTo(java.io.File destination) throws java.io.IOException
Copies this folder object to the given destination folder. Just calls
copyTo(Folder)
with the Folder
created from
destination
.
destination
- where to copy the folder to
java.io.IOException
- on problems with the streamsFile.copyTo(java.lang.String)
,
copyTo(Folder)
public final boolean deleteContents()
Deletes the folder and recursively all its subdirectories. Returns
false
if the folder is no directory.
public final boolean deleteWithContents()
Deletes recursively all the subdirectories, the contending files and at last the folder itself.
public final boolean hasSubdirectories()
Returns true
when there is at least one subdirectory or
false
if there is none. If the folder is no directory it
will return false
as well.
public final java.io.File[] listFiles()
Inherited from java.io.File
. Returns an array of
java.io.File
but the results may be casted to
de.goerntkai.toolbox.misc.File
or
de.goerntkai.toolbox.misc.Foler
.
java.io.File
File.listFiles()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |