Media Authoring
with Java API

tv.amwa.maj.iface
Interface AAFFile

All Known Subinterfaces:
RandomFile

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

Author:
Richard Cartwright
See Also:
AAFFactory.makeAAFFile()

Method Summary
 void close()
          Dissociates this AAFFile from its storage.
 Dictionary getDictionary()
          Returns the dictionary that contains all types of AAF definition objects for the file.
 Header getHeader()
          Returns the header 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.

getHeader

Header getHeader()
                 throws NotOpenException,
                        NoHeaderException

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

Returns:
Header of the file.
Throws:
NotOpenException - The object is not open.
NoHeaderException - The object contains no header.

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 header is created.

Returns:
The dictionary of this file.
See Also:
Header.getDictionary()

Media Authoring
with Java API

(c) 2007-2008 Richard Cartwright, all rights reserved. Subject to the terms of the AAF SDK Public Source License.