Package org.eclipse.birt.core.archive
Interface IDocArchiveReader
- All Known Implementing Classes:
ArchiveReader
,FileArchiveReader
,FolderArchive
,FolderArchiveReader
public interface IDocArchiveReader
An interface that wraps around a report archive for reading. A report archive
may be, but is not limited to a zip file in compressed format, a folder in
uncompressed format.
Notice that the interface does not define archive file name, nor does it
define folder name to store/uncompress the archive to. Setting such
environments up is implementation class's responsibility. To external users
of IReportArchive, it only cares what he can retrieve from the archive.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
This function must be called after the reader is used.boolean
getInputStream
(String relativePath) getName()
returns a sequential access file.get all the stream in the archive file.listStreams
(String relativeStoragePath) try to lock the streamvoid
open()
This functiona must be called before the reader is used.void
unlock the stream locked by the object.
-
Method Details
-
getName
String getName()- Returns:
- the archive name
-
open
This functiona must be called before the reader is used. initialize the document archive. For example, the index stream mey be read into memory.- Throws:
IOException
-
getStream
returns a sequential access file.- Parameters:
relativePath
- - the relative stream path in the archive. The relative path is based on Unix syntax, with the root of the archive denoted by "/". The initial "/" character can be skipped. Used mainly for sequential streams in report.- Returns:
- RAInputStream
- Throws:
IOException
-
getInputStream
- Throws:
IOException
-
exists
- Parameters:
relativePath
- - the relative stream path in the archive. The relative path is based on Unix syntax, with the root of the archive denoted by "/". The initial "/" character can be skipped. Used mainly for sequential streams in report.- Returns:
- whether the stream exist
-
listStreams
- Parameters:
relativeStoragePath
- - the relative stream path in the archive. The relative path is based on Unix syntax, with the root of the archive denoted by "/". The initial "/" character can be skipped.- Returns:
- a list of strings representing the underlying stream names. The return values are in the relative path format too.
- Throws:
IOException
-
listAllStreams
get all the stream in the archive file.- Returns:
- Throws:
IOException
-
close
This function must be called after the reader is used. close the archive.- Throws:
IOException
-
lock
try to lock the stream- Parameters:
stream
-- Returns:
- the locker.
- Throws:
IOException
-
unlock
unlock the stream locked by the object.- Parameters:
locker
- object returned by the lock().- Throws:
IOException
-