AAFFile (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.model

## Interface AAFFile

- All Known Subinterfaces:
    RandomFile
  All Known Implementing Classes:
    AAFFile

      public interface AAFFile

  Specifies a representation of an AAF file.

  Note that in the current version of the MAJ API, no support is provided for AAF structured format or KLV files. The MAJ API implementation of this method does nothing useful. This and related methods are provided as part of a skeleton implementation of an interface similar to that provided in the existing C-based reference implementation COM interface definitions (file "`AAF.idl`").

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Dissociates this AAFFile from its storage.
    `Dictionary` | `getDictionary()` Returns the dictionary that contains all types of AAF definition objects for the file.
    `Preface` | `getPreface()` Returns the preface associated with this file.
    `FileRev` | `getRevision()` Returns the revision of the file.
    `void` | `open()` Associates this AAFFile with the storage to which it is to be associated.
    `void` | `save()` If this AAFFile is open, all unsaved changes made to the contents of this object are saved.
    `void` | `saveCopyAs(AAFFile destFile)` Copies the contents of this file to a given destination file.

- - ### Method Detail

    - #### open

          void open()
             throws AlreadyOpenException

      Associates this AAFFile with the storage to which it is to be associated. It will then be possible to access objects within this file.

      Throws:
        `AlreadyOpenException` - This object has already been opened.

    - #### saveCopyAs

          void saveCopyAs(AAFFile destFile)
                   throws NotOpenException,
                          NotWriteableException

      Copies the contents of this file to a given destination file. Requires that the destination file be open, writable or modifiable, and not yet contain any objects.

      Parameters:
        `destFile` - File to receive a copy of the contents of this file.
      Throws:
        `NotOpenException` - The destination file is not open.
        `NotWriteableException` - The destination file cannot be written. One reason may be that it already contains objects.

    - #### getPreface

          Preface getPreface()
                      throws NotOpenException,
                             NoPrefaceException

      Returns the preface associated with this file. If this object has never been associated with a file, a new empty preface will be created and returned. Note that the preface is automatically created when the file object is created.

      Returns:
        Preface of the file.
      Throws:
        `NotOpenException` - The object is not open.
        `NoPrefaceException` - The object contains no preface.

    - #### getRevision

          FileRev getRevision()
                       throws NotOpenException

      Returns the revision of the file.

      Returns:
        Revision of the file.
      Throws:
        `NotOpenException` - The object is not open.

    - #### save

          void save()
             throws NotOpenException,
                    WrongOpenModeException,
                    InsufficientSpaceException

      If this AAFFile is open, all unsaved changes made to the contents of this object are saved.

      Throws:
        `NotOpenException` - The object is not open.
        `WrongOpenModeException` - This object is not open for writing or modification.
        `InsufficientSpaceException` - There is insufficient space in the storage to save the contents of this object.

    - #### close

          void close()
              throws NotOpenException

      Dissociates this AAFFile from its storage. Any AAF objects which were contained within this object will then no longer be available to the client.

      If the client is maintaining any references to any objects which are contained in this object, those objects will be marked as dissociated, and methods on them will fail.

      Any unsaved changes will be written to the file before the close operation is complete.

      Throws:
        `NotOpenException` - This object is not already open.

    - #### getDictionary

          Dictionary getDictionary()

      Returns the dictionary that contains all types of AAF definition objects for the file. Note that the dictionary is automatically created when the preface is created.

      Returns:
        The dictionary of this file.
      See Also:
        `Preface.getDictionaries()`

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.