Class ArchiveFileFactory
- java.lang.Object
-
- org.eclipse.birt.core.archive.compound.ArchiveFileFactory
-
- All Implemented Interfaces:
IArchiveFileFactory
public class ArchiveFileFactory extends java.lang.Object implements IArchiveFileFactory
-
-
Constructor Summary
Constructors Constructor Description ArchiveFileFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IArchiveFilecreateArchive(java.lang.String archiveId)Create an archive file.IArchiveFilecreateTransientArchive(java.lang.String archiveId)Create an archive in transient mode.IArchiveFilecreateTransientView(java.lang.String viewId, IArchiveFile archive)Create a transient view.IArchiveFilecreateView(java.lang.String viewId, IArchiveFile archive)Create a view, the view uses "viewId" as the identifier and saved into file "filename".protected java.lang.StringgetPhysicalFile(java.lang.String systemId)The sub class should override this method to implement its own systemId resolver.IArchiveFileopenArchive(java.lang.String archiveId, java.lang.String mode)Open the archive or view.IArchiveFileopenView(java.lang.String viewId, java.lang.String mode, IArchiveFile archive)Open the view with viewId inmodemode, the depend archive file is opened in r mode, and is shared.
-
-
-
Method Detail
-
createArchive
public IArchiveFile createArchive(java.lang.String archiveId) throws java.io.IOException
Description copied from interface:IArchiveFileFactoryCreate an archive file. The created archive usesarchiveIdas 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:
createArchivein interfaceIArchiveFileFactory- Parameters:
archiveId- the system id of the new archive file- Returns:
- an archive file with the
archiveId - Throws:
java.io.IOException
-
createTransientArchive
public IArchiveFile createTransientArchive(java.lang.String archiveId) throws java.io.IOException
Description copied from interface:IArchiveFileFactoryCreate an archive in transient mode.- Specified by:
createTransientArchivein interfaceIArchiveFileFactory- Returns:
- Throws:
java.io.IOException
-
createView
public IArchiveFile createView(java.lang.String viewId, IArchiveFile archive) throws java.io.IOException
Description copied from interface:IArchiveFileFactoryCreate 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:
createViewin interfaceIArchiveFileFactory- Parameters:
viewId- the system id of the new view filearchive- the depended archive file instance- Returns:
- Throws:
java.io.IOException
-
createTransientView
public IArchiveFile createTransientView(java.lang.String viewId, IArchiveFile archive) throws java.io.IOException
Description copied from interface:IArchiveFileFactoryCreate a transient view.- Specified by:
createTransientViewin interfaceIArchiveFileFactory- Parameters:
viewId- the system id of the new view filearchive- the depended archive file instance- Returns:
- Throws:
java.io.IOException
-
openArchive
public IArchiveFile openArchive(java.lang.String archiveId, java.lang.String mode) throws java.io.IOException
Description copied from interface:IArchiveFileFactoryOpen 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. view&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:
openArchivein interfaceIArchiveFileFactory- Parameters:
archiveId- the system id of the opening archivemode- opening mode- Returns:
- opened archive
- Throws:
java.io.IOException
-
openView
public IArchiveFile openView(java.lang.String viewId, java.lang.String mode, IArchiveFile archive) throws java.io.IOException
Description copied from interface:IArchiveFileFactoryOpen the view with viewId inmodemode, 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:
openViewin interfaceIArchiveFileFactory- Parameters:
viewId- the system id of the opening viewmode- opening modearchive- depend archive file- Returns:
- opened view
- Throws:
java.io.IOException
-
getPhysicalFile
protected java.lang.String getPhysicalFile(java.lang.String systemId)
The sub class should override this method to implement its own systemId resolver.- Parameters:
systemId-- Returns:
- the physical file name
-
-