Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.loaders 5.9.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openide.loaders
Class FileEntry.Format

    java.lang.Object
      org.openide.loaders.MultiDataObject.Entry
          org.openide.loaders.FileEntry
              org.openide.loaders.FileEntry.Format

All Implemented Interfaces:
  Serializable

Enclosing class:
  FileEntry

    public abstract static class FileEntry.Format

extends FileEntry

Specialized entry that simplifies substitution when a file entry is created from template. Subclasses must implement `createFormat(org.openide.filesystems.FileObject, java.lang.String, java.lang.String)` and return a valid text format that will be used for converting the lines of the original file to lines in the newly created one.

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class org.openide.loaders.FileEntry
`FileEntry.Folder, FileEntry.Format, FileEntry.Numb`

Constructor Summary
`FileEntry.Format(MultiDataObject obj, FileObject fo)` Create a new entry initially attached to a given file object.

Method Summary
`protected abstract Format` | `createFormat(FileObject target, String n, String e)` Provide a suitable format for substitution of lines.
`FileObject` | `createFromTemplate(FileObject f, String name)` Called when the entry is to be created from a template.

Methods inherited from class org.openide.loaders.FileEntry
`copy, delete, move, rename`

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.Format

    public FileEntry.Format(MultiDataObject obj,
                            FileObject fo)

  Create a new 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

### 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 `FileEntry`
  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

### createFormat

    protected abstract Format createFormat(FileObject target,
                                           String n,
                                           String e)

  Provide a suitable format for substitution of lines.

  Parameters:
    `target` - the target folder of the installation
    `n` - the name the file will have
    `e` - the extension the file will have
  Returns:
    a format to use for formatting lines

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.loaders 5.9.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.