Package org.eclipse.birt.core.archive.compound

# Class ArchiveFileFactory

java.lang.Object
org.eclipse.birt.core.archive.compound.ArchiveFileFactory

All Implemented Interfaces:
  `IArchiveFileFactory`

public class ArchiveFileFactory extends Object implements IArchiveFileFactory

## Constructor Summary

Constructors
Constructor
Description
`ArchiveFileFactory()`

## Method Summary

Modifier and Type
Method
Description
`IArchiveFile`
`createArchive(String archiveId)`
Create an archive file.
`IArchiveFile`
`createTransientArchive(String archiveId)`
Create an archive in transient mode.
`IArchiveFile`
`createTransientView(String viewId, IArchiveFile archive)`
Create a transient view.
`IArchiveFile`
`createView(String viewId, IArchiveFile archive)`
Create a view, the view uses "viewId" as the identifier and saved into file "filename".
`protected String`
`getPhysicalFile(String systemId)`
The sub class should override this method to implement its own systemId resolver.
`IArchiveFile`
`openArchive(String archiveId, String mode)`
Open the archive or view.
`IArchiveFile`
`openView(String viewId, String mode, IArchiveFile archive)`
Open the view with viewId in `mode` mode, the depend archive file is opened in r mode, and is shared.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ArchiveFileFactory

public ArchiveFileFactory()

## Method Details

### createArchive

public IArchiveFile createArchive(String archiveId) throws IOException
Description copied from interface: `IArchiveFileFactory`
Create an archive file. The created archive uses `archiveId` as the identifier. If the file has exist already, the file is removed first. It can only be used to create an archive. To create a view, the user needs use createView.

Specified by:
  `createArchive` in interface `IArchiveFileFactory`
Parameters:
  `archiveId` - the system id of the new archive file
Returns:
  an archive file with the `archiveId`
Throws:
  `IOException`

### createTransientArchive

public IArchiveFile createTransientArchive(String archiveId) throws IOException
Description copied from interface: `IArchiveFileFactory`
Create an archive in transient mode.

Specified by:
  `createTransientArchive` in interface `IArchiveFileFactory`
Parameters:
  `archiveId` -
Returns:
Throws:
  `IOException`

### createView

public IArchiveFile createView(String viewId, IArchiveFile archive) throws IOException
Description copied from interface: `IArchiveFileFactory`
Create a view, the view uses "viewId" as the identifier and saved into file "filename". The base archive "archive" can be either a view or an archive. If it is a view, the new generated view is based on the original archive.

Specified by:
  `createView` in interface `IArchiveFileFactory`
Parameters:
  `viewId` - the system id of the new view file
  `archive` - the depended archive file instance
Returns:
Throws:
  `IOException`

### createTransientView

public IArchiveFile createTransientView(String viewId, IArchiveFile archive) throws IOException
Description copied from interface: `IArchiveFileFactory`
Create a transient view.

Specified by:
  `createTransientView` in interface `IArchiveFileFactory`
Parameters:
  `viewId` - the system id of the new view file
  `archive` - the depended archive file instance
Returns:
Throws:
  `IOException`

### openArchive

public IArchiveFile openArchive(String archiveId, String mode) throws IOException
Description copied from interface: `IArchiveFileFactory`
Open the archive or view. The mode can be either: - "r" the archive file is opened for read only. - "rw" the archive file is opened for read and write. - "rw+" the archive file is opened for read and append. 1. in "r" mode a. view: open view in r mode, and open archive in r mode at the same time. b. archive: open archive in r mode directly. 2. in "rw" mode a. viewinvalid input: '&archive': only create new archive file 3. in "rw+" a. view: open view in rw+ mode, and open archive in r mode at the same time. b. archive: open archive in rw+ mode.

Specified by:
  `openArchive` in interface `IArchiveFileFactory`
Parameters:
  `archiveId` - the system id of the opening archive
  `mode` - opening mode
Returns:
  opened archive
Throws:
  `IOException`

### openView

public IArchiveFile openView(String viewId, String mode, IArchiveFile archive) throws IOException
Description copied from interface: `IArchiveFileFactory`
Open the view with viewId in `mode` mode, the depend archive file is opened in r mode, and is shared. The mode can be either: - "r" the view file is opened for read only. - "rw" the view file is opened for read and write. - "rw+" the view file is opened for read and append. The depend archive file will not be closed when view file is closed.

Specified by:
  `openView` in interface `IArchiveFileFactory`
Parameters:
  `viewId` - the system id of the opening view
  `mode` - opening mode
  `archive` - depend archive file
Returns:
  opened view
Throws:
  `IOException`

### getPhysicalFile

protected String getPhysicalFile(String systemId)
The sub class should override this method to implement its own systemId resolver.

Parameters:
  `systemId` -
Returns:
  the physical file name