Class MultiDataObject.Entry
java.lang.Object
org.openide.loaders.MultiDataObject.Entry
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FileEntry
,FileEntry.Folder
,FileEntry.Numb
- Enclosing class:
MultiDataObject
Represents one file in a
group data object
.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.openide.filesystems.FileObject
Called when the entry is to be copied.org.openide.filesystems.FileObject
copyRename
(org.openide.filesystems.FileObject f, String name, String ext) Called when the entry is to be copied and renamed.abstract org.openide.filesystems.FileObject
createFromTemplate
(org.openide.filesystems.FileObject f, String name) Called when the entry is to be created from a template.abstract void
delete()
Called when the entry is to be deleted.boolean
final MultiDataObject
Get the multi data object this entry is assigned to.final org.openide.filesystems.FileObject
getFile()
Get the file this entry works with.int
hashCode()
boolean
Method that allows to check whether an entry is important or is not.boolean
isLocked()
Tests whether the entry is locked.abstract org.openide.filesystems.FileObject
Called when the entry is to be moved.abstract org.openide.filesystems.FileObject
Called when the entry is to be renamed.org.openide.filesystems.FileLock
takeLock()
Try to lock this file entry.protected Object
Make a Serialization replacement.
-
Constructor Details
-
Entry
protected Entry(org.openide.filesystems.FileObject file)
-
-
Method Details
-
getFile
public final org.openide.filesystems.FileObject getFile()Get the file this entry works with. -
getDataObject
Get the multi data object this entry is assigned to.- Returns:
- the data object
-
isImportant
public boolean isImportant()Method that allows to check whether an entry is important or is not. Should be overriden by subclasses, the current implementation returns true.- Returns:
- true if this entry is important or false if not
-
copy
public abstract org.openide.filesystems.FileObject copy(org.openide.filesystems.FileObject f, String suffix) throws IOException Called when the entry is to be copied. Depending on the entry type, it should either copy the underlyingFileObject
, or do nothing (if it cannot be copied).- Parameters:
f
- the folder to create this entry insuffix
- the suffix to add to the name of original file- Returns:
- the copied
FileObject
ornull
if it cannot be copied - Throws:
IOException
- when the operation fails
-
rename
Called when the entry is to be renamed. Depending on the entry type, it should either rename the underlyingFileObject
, or delete it (if it cannot be renamed).- Parameters:
name
- the new name- Returns:
- the renamed
FileObject
ornull
if it has been deleted - Throws:
IOException
- when the operation fails
-
move
public abstract org.openide.filesystems.FileObject move(org.openide.filesystems.FileObject f, String suffix) throws IOException Called when the entry is to be moved. Depending on the entry type, it should either move the underlyingFileObject
, or delete it (if it cannot be moved).- Parameters:
f
- the folder to move this entry tosuffix
- the suffix to use- Returns:
- the moved
FileObject
ornull
if it has been deleted - Throws:
IOException
- when the operation fails
-
delete
Called when the entry is to be deleted.- Throws:
IOException
- when the operation fails
-
createFromTemplate
public abstract org.openide.filesystems.FileObject createFromTemplate(org.openide.filesystems.FileObject f, String name) throws IOException Called when the entry is to be created from a template. Depending on the entry type, it should either copy the underlyingFileObject
, or do nothing (if it cannot be copied).- Parameters:
f
- the folder to create this entry inname
- the new name to use- Returns:
- the copied
FileObject
ornull
if it cannot be copied - Throws:
IOException
- when the operation fails
-
copyRename
public org.openide.filesystems.FileObject copyRename(org.openide.filesystems.FileObject f, String name, String ext) throws IOException Called when the entry is to be copied and renamed.- Parameters:
f
- the folder to create this entry inname
- new file nameext
- new file extension- Returns:
- the copied and renamed
FileObject
, never null - Throws:
IOException
- when the operation fails- Since:
- 6.3
-
takeLock
Try to lock this file entry.- Returns:
- the lock if the operation was successful; otherwise
null
- Throws:
IOException
- if the lock could not be taken
-
isLocked
public boolean isLocked()Tests whether the entry is locked.- Returns:
true
if so
-
equals
-
hashCode
-
writeReplace
Make a Serialization replacement. The entry is identified by the file object is holds. When serialized, it stores the file object and the data object. On deserialization it finds the data object and creates the right entry for it.
-