org.openide.loaders
Class FileEntry

java.lang.Object
  |
  +--org.openide.loaders.MultiDataObject.Entry
        |
        +--org.openide.loaders.FileEntry
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FileEntry.Format

public class FileEntry
extends MultiDataObject.Entry

Entry that works with plain files. Copies, moves, renames and deletes them without any modification.

See Also:
Serialized Form

Inner Class Summary
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 Summary
FileEntry(MultiDataObject obj, FileObject fo)
          Creates new file entry initially attached to a given file object.
 
Method Summary
 FileObject copy(FileObject f, String suffix)
          Called when the entry is to be copied.
 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.
 
Methods inherited from class org.openide.loaders.MultiDataObject.Entry
equals, getDataObject, getFile, hashCode, isImportant, isLocked, takeLock, writeReplace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileEntry

public FileEntry(MultiDataObject obj,
                 FileObject fo)
Creates new file entry initially attached to a given file object.
Parameters:
obj - the data object this entry belongs to
fo - the file object for the entry
Method Detail

copy

public FileObject copy(FileObject f,
                       String suffix)
                throws IOException
Description copied from class: MultiDataObject.Entry
Called when the entry is to be copied. Depending on the entry type, it should either copy the underlying FileObject, or do nothing (if it cannot be copied).
Overrides:
copy in class MultiDataObject.Entry
Following copied from class: org.openide.loaders.MultiDataObject.Entry
Parameters:
f - the folder to create this entry in
name - the new name to use
Returns:
the copied FileObject or null if it cannot be copied
Throws:
IOException - when the operation fails

rename

public FileObject rename(String name)
                  throws IOException
Description copied from class: MultiDataObject.Entry
Called when the entry is to be renamed. Depending on the entry type, it should either rename the underlying FileObject, or delete it (if it cannot be renamed).
Overrides:
rename in class MultiDataObject.Entry
Following copied from class: org.openide.loaders.MultiDataObject.Entry
Parameters:
name - the new name
Returns:
the renamed FileObject or null if it has been deleted
Throws:
IOException - when the operation fails

move

public FileObject move(FileObject f,
                       String suffix)
                throws IOException
Description copied from class: MultiDataObject.Entry
Called when the entry is to be moved. Depending on the entry type, it should either move the underlying FileObject, or delete it (if it cannot be moved).
Overrides:
move in class MultiDataObject.Entry
Following copied from class: org.openide.loaders.MultiDataObject.Entry
Parameters:
f - the folder to move this entry to
suffix - the suffix to use
Returns:
the moved FileObject or null if it has been deleted
Throws:
IOException - when the operation fails

delete

public void delete()
            throws IOException
Description copied from class: MultiDataObject.Entry
Called when the entry is to be deleted.
Overrides:
delete in class MultiDataObject.Entry
Following copied from class: org.openide.loaders.MultiDataObject.Entry
Throws:
IOException - when the operation fails

createFromTemplate

public FileObject createFromTemplate(FileObject f,
                                     String name)
                              throws IOException
Description copied from class: MultiDataObject.Entry
Called when the entry is to be created from a template. Depending on the entry type, it should either copy the underlying FileObject, or do nothing (if it cannot be copied).
Overrides:
createFromTemplate in class MultiDataObject.Entry
Following copied from class: org.openide.loaders.MultiDataObject.Entry
Parameters:
f - the folder to create this entry in
name - the new name to use
Returns:
the copied FileObject or null if it cannot be copied
Throws:
IOException - when the operation fails


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.