站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.1

FileEntry (NetBeans Loaders API) - NetBeans API Javadoc 5.5.1

org.openide.loaders 5.9.31

org.openide.loaders
Class FileEntry

java.lang.Object
  extended by org.openide.loaders.MultiDataObject.Entry
      extended by 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

Nested 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).

Specified by:
copy in class MultiDataObject.Entry
Parameters:
f - the folder to create this entry in
suffix - the suffix to add to the name of original file
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).

Specified by:
rename in class 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).

Specified by:
move in class 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.

Specified by:
delete in class 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).

Specified by:
createFromTemplate in class 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

org.openide.loaders 5.9.31

Built on March 26 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.