Package org.eclipse.birt.core.archive
Class FolderArchiveWriter
java.lang.Object
org.eclipse.birt.core.archive.FolderArchiveWriter
- All Implemented Interfaces:
IDocArchiveWriter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createOutputStream(String relativePath) createRandomAccessStream(String relativePath) Create a random access stream in the archive and return it.booleandropStream(String relativePath) Delete a stream from the archive and make sure the stream has been closed.booleanvoidfinish()This function must be called after the writer is used.voidflush()This function flushs all the buffers in the writerGet archive filegetInputStream(String relativePath) getName()getOutputStream(String relativePath) voidThis function must be called before the writer is used.get all the stream in the archive file.listStreams(String relativeStoragePath) return a list of strings which are the relative path of streamstry to lock the streamopenRandomAccessStream(String relativePath) voidsetStreamSorter(IStreamSorter streamSorter) Set the stream sorter (if needed).voidtoFileArchive(String fileArchiveName) Convert the current folder archive to file archive.voidunlock the stream locked by the object.
-
Constructor Details
-
FolderArchiveWriter
- Parameters:
absolute- fileName the archive file name- Throws:
IOException
-
-
Method Details
-
initialize
public void initialize()Description copied from interface:IDocArchiveWriterThis function must be called before the writer is used. initialize the document archive.- Specified by:
initializein interfaceIDocArchiveWriter
-
createRandomAccessStream
Description copied from interface:IDocArchiveWriterCreate a random access stream in the archive and return it.- Specified by:
createRandomAccessStreamin interfaceIDocArchiveWriter- Parameters:
relativePath- - relative path to report archive path. The path is based on Unix syntax, with the root of the archive denoted by "/". The initial "/" character can be skipped.- Returns:
- RAOutputStream
- Throws:
IOException
-
openRandomAccessStream
- Specified by:
openRandomAccessStreamin interfaceIDocArchiveWriter- Throws:
IOException
-
createOutputStream
- Specified by:
createOutputStreamin interfaceIDocArchiveWriter- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStreamin interfaceIDocArchiveWriter- Throws:
IOException
-
getInputStream
- Specified by:
getInputStreamin interfaceIDocArchiveWriter- Throws:
IOException
-
dropStream
Delete a stream from the archive and make sure the stream has been closed.- Specified by:
dropStreamin interfaceIDocArchiveWriter- Parameters:
relativePath- - the relative path of the stream- Returns:
- whether the delete operation was successful
- Throws:
IOException
-
getName
- Specified by:
getNamein interfaceIDocArchiveWriter- Returns:
- the archive name
-
exists
- Specified by:
existsin interfaceIDocArchiveWriter- 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.- Returns:
- a list of strings representing the underlying stream names. The return values are in the relative path format too.
-
setStreamSorter
Description copied from interface:IDocArchiveWriterSet the stream sorter (if needed). The stream sorter will be used to sort the streams. If no stream sorter is set, the streams will be written in random order.- Specified by:
setStreamSorterin interfaceIDocArchiveWriter- Parameters:
streamSorter- - the stream sorter
-
finish
Description copied from interface:IDocArchiveWriterThis function must be called after the writer is used. finalizes the socument archive. This may involve compressing the archive to a single file. This also closes and finishes using the archive.- Specified by:
finishin interfaceIDocArchiveWriter- Throws:
IOException
-
close
- Throws:
IOException
-
toFileArchive
Convert the current folder archive to file archive. The original folder archive will NOT be removed.- Parameters:
fileArchiveName-- Throws:
IOException
-
flush
Description copied from interface:IDocArchiveWriterThis function flushs all the buffers in the writer- Specified by:
flushin interfaceIDocArchiveWriter- Throws:
IOException
-
lock
Description copied from interface:IDocArchiveWritertry to lock the stream- Specified by:
lockin interfaceIDocArchiveWriter- Returns:
- the locker.
- Throws:
IOException
-
unlock
Description copied from interface:IDocArchiveWriterunlock the stream locked by the object.- Specified by:
unlockin interfaceIDocArchiveWriter- Parameters:
lock- object returned by the lock().
-
listStreams
return a list of strings which are the relative path of streams- Specified by:
listStreamsin interfaceIDocArchiveWriter- 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
Description copied from interface:IDocArchiveWriterget all the stream in the archive file.- Specified by:
listAllStreamsin interfaceIDocArchiveWriter- Returns:
- Throws:
IOException
-
getArchiveFile
Description copied from interface:IDocArchiveWriterGet archive file- Specified by:
getArchiveFilein interfaceIDocArchiveWriter- Returns:
-