public class FileEntry extends MultiDataObject.Entry
Modifier and Type | Class and Description |
---|---|
static class |
FileEntry.Folder
Simple entry for handling folders, on copy, move and createFromTemplate
it creates new empty folder and copies attributes of source folder.
|
static class |
FileEntry.Format
Specialized entry that simplifies substitution when a file entry
is created from template.
|
static class |
FileEntry.Numb
Simple file entry variant.
|
Constructor and Description |
---|
FileEntry(MultiDataObject obj,
FileObject fo)
Creates new file entry initially attached to a given file object.
|
Modifier and Type | Method and Description |
---|---|
FileObject |
copy(FileObject f,
String suffix)
Called when the entry is to be copied.
|
FileObject |
copyRename(FileObject f,
String name,
String ext)
Called when the entry is to be copied and renamed.
|
FileObject |
createFromTemplate(FileObject f,
String name)
Called when the entry is to be created from a template.
|
void |
delete()
Called when the entry is to be deleted.
|
FileObject |
move(FileObject f,
String suffix)
Called when the entry is to be moved.
|
FileObject |
rename(String name)
Called when the entry is to be renamed.
|
equals, getDataObject, getFile, hashCode, isImportant, isLocked, takeLock, writeReplace
public FileEntry(MultiDataObject obj, FileObject fo)
obj
- the data object this entry belongs tofo
- the file object for the entrypublic FileObject copy(FileObject f, String suffix) throws IOException
MultiDataObject.Entry
FileObject
,
or do nothing (if it cannot be copied).copy
in class MultiDataObject.Entry
f
- the folder to create this entry insuffix
- the suffix to add to the name of original fileFileObject
or null
if it cannot be copiedIOException
- when the operation failspublic FileObject copyRename(FileObject f, String name, String ext) throws IOException
MultiDataObject.Entry
copyRename
in class MultiDataObject.Entry
f
- the folder to create this entry inname
- new file nameext
- new file extensionFileObject
, never nullIOException
- when the operation failspublic FileObject rename(String name) throws IOException
MultiDataObject.Entry
FileObject
,
or delete it (if it cannot be renamed).rename
in class MultiDataObject.Entry
name
- the new nameFileObject
or null
if it has been deletedIOException
- when the operation failspublic FileObject move(FileObject f, String suffix) throws IOException
MultiDataObject.Entry
FileObject
,
or delete it (if it cannot be moved).move
in class MultiDataObject.Entry
f
- the folder to move this entry tosuffix
- the suffix to useFileObject
or null
if it has been deletedIOException
- when the operation failspublic void delete() throws IOException
MultiDataObject.Entry
delete
in class MultiDataObject.Entry
IOException
- when the operation failspublic FileObject createFromTemplate(FileObject f, String name) throws IOException
MultiDataObject.Entry
FileObject
,
or do nothing (if it cannot be copied).createFromTemplate
in class MultiDataObject.Entry
f
- the folder to create this entry inname
- the new name to useFileObject
or null
if it cannot be copiedIOException
- when the operation fails