|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object se.entitymanager.logic.file.AbstractFile se.entitymanager.logic.file.DirectoryFile
public class DirectoryFile
An entity that represents a directory of the file system.
Field Summary | |
---|---|
private java.util.List |
children
List of files within the directory. |
private java.io.File |
file
Associated java.io.File object. |
Fields inherited from class se.entitymanager.logic.file.AbstractFile |
---|
fileContents, lastModified, name, parent, readable, size, writeable |
Constructor Summary | |
---|---|
protected |
DirectoryFile(java.io.File file,
AbstractFile parent)
Constructs an directory entity with name and parent . |
Method Summary | |
---|---|
protected void |
copy()
Copy this file. |
protected void |
delete()
Deletes this file. |
protected java.util.List |
getAllChildren()
Returns all direct child files. |
protected java.io.File |
getFile()
Returns associated file object. |
java.lang.String |
getFileContents()
Returns the contents of this file. |
protected boolean |
isFolderish()
Returns whether this file is folderish. |
protected void |
paste()
Paste the file from the clipboard. |
protected void |
pasteTo()
|
protected void |
rename(java.lang.String newName)
Renames this file to newName . |
Methods inherited from class se.entitymanager.logic.file.AbstractFile |
---|
getLastModified, getName, getParent, getSize, isReadable, isWriteable, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.List children
All objects in this list are instances derived from AbstractFile.
private java.io.File file
java.io.File
object.
Constructor Detail |
---|
protected DirectoryFile(java.io.File file, AbstractFile parent)
name
and parent
.
file
must be a directory.
file
- associated java.io.File
objectparent
- parent entityMethod Detail |
---|
protected java.io.File getFile()
protected boolean isFolderish()
AbstractFile
Folderish files like directories or zip files may contain other files.
isFolderish
in class AbstractFile
protected java.util.List getAllChildren() throws EntityNotFolderishException
AbstractFile
The objects within the list are instances derived from AbstractFile
getAllChildren
in class AbstractFile
EntityNotFolderishException
- if this file is not folderishprotected void rename(java.lang.String newName) throws EntityRenameFailedException
AbstractFile
newName
.
rename
in class AbstractFile
newName
- new name of this file.
EntityRenameFailedException
- if an error occurredprotected void delete() throws EntityDeletionFailedException
AbstractFile
delete
in class AbstractFile
EntityDeletionFailedException
- if an error occurredprotected void copy() throws EntityCopyCutFailedException
AbstractFile
copy
in class AbstractFile
EntityCopyCutFailedException
- if an error occurredprotected void paste() throws EntityPasteFailedException
AbstractFile
paste
in class AbstractFile
EntityPasteFailedException
- if an error occurredprotected void pasteTo() throws EntityPasteFailedException
EntityPasteFailedException
public java.lang.String getFileContents()
AbstractFile
getFileContents
in class AbstractFile
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |