com.borland.primetime.node
Class ProjectStorage

java.lang.Object
  |
  +--com.borland.primetime.node.ProjectStorage

public abstract class ProjectStorage
extends java.lang.Object


Field Summary
protected  Project project
           
 
Constructor Summary
ProjectStorage(Project project)
          ProjectStorage instances all have an associated project that they read / write.
 
Method Summary
 boolean canWriteProject()
          Describes whether or not a ProjectStorage is capable of writing a project file.
protected  FileNode createParentedFileNode(Project project, Node parent, Url url)
           
 byte[] getBufferContent()
           
static Url getDefaultProjectUrl()
           
 void initializeProject()
           
protected abstract  void readProject(java.io.InputStream inputStream, Url rootUrl)
           
static void registerStorageClass(java.lang.String extension, java.lang.String description, java.lang.Class storageClass)
          Add a new storage type to the registry of known types and their associated extensions.
static void setDefaultProjectUrl(Url defaultProjectUrl)
           
protected  void writeProject(java.io.OutputStream outputStream, Url rootUrl, java.util.List nodes)
          Saves the
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

project

protected Project project
Constructor Detail

ProjectStorage

public ProjectStorage(Project project)
ProjectStorage instances all have an associated project that they read / write.
Method Detail

setDefaultProjectUrl

public static void setDefaultProjectUrl(Url defaultProjectUrl)

getDefaultProjectUrl

public static Url getDefaultProjectUrl()

createParentedFileNode

protected FileNode createParentedFileNode(Project project,
                                          Node parent,
                                          Url url)
                                   throws DuplicateNodeException

readProject

protected abstract void readProject(java.io.InputStream inputStream,
                                    Url rootUrl)
                             throws java.lang.Exception

initializeProject

public void initializeProject()

canWriteProject

public boolean canWriteProject()

Describes whether or not a ProjectStorage is capable of writing a project file. This method is primarily intended for use by ProjectStorage subclasses that provide read-only access to a particular project file format.

The basic ProjectStorage implementation for this method returns false.

Returns:
True if writeProject can be called on this ProjectStorage instance, false otherwise.

writeProject

protected void writeProject(java.io.OutputStream outputStream,
                            Url rootUrl,
                            java.util.List nodes)
                     throws java.io.IOException
Saves the

getBufferContent

public byte[] getBufferContent()

registerStorageClass

public static void registerStorageClass(java.lang.String extension,
                                        java.lang.String description,
                                        java.lang.Class storageClass)
Add a new storage type to the registry of known types and their associated extensions.
Parameters:
type - The extension that this registration is associated with. Extensions are case-insensitive and do not include the leading period character.
storageClass - A subclass of ProjectStorage that should be instantiated to load and save projects with the matching extension.