Class FolderArchive

    • Constructor Detail

      • FolderArchive

        public FolderArchive​(java.lang.String folderName)
                      throws java.io.IOException
        Parameters:
        absolute - fileName the archive file name
        Throws:
        java.io.IOException
    • Method Detail

      • initialize

        public void initialize()
                        throws java.io.IOException
        Description copied from interface: IDocArchiveWriter
        This function must be called before the writer is used. initialize the document archive.
        Specified by:
        initialize in interface IDocArchiveWriter
        Throws:
        java.io.IOException
      • createRandomAccessStream

        public RAOutputStream createRandomAccessStream​(java.lang.String relativePath)
                                                throws java.io.IOException
        Description copied from interface: IDocArchiveWriter
        Create a random access stream in the archive and return it.
        Specified by:
        createRandomAccessStream in interface IDocArchiveWriter
        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:
        java.io.IOException
      • dropStream

        public boolean dropStream​(java.lang.String relativePath)
        Description copied from interface: IDocArchiveWriter
        Delete a stream from the archive. Note: Not all of the derived classes support this function. E.g. FileArchiveWriter doesn't support it.
        Specified by:
        dropStream in interface IDocArchiveWriter
        Parameters:
        relativePath - - the relative path of the stream
        Returns:
        whether the operation was successful
      • exists

        public boolean exists​(java.lang.String relativePath)
        Specified by:
        exists in interface IDocArchiveReader
        Specified by:
        exists in interface IDocArchiveWriter
        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

        public void setStreamSorter​(IStreamSorter streamSorter)
        Description copied from interface: IDocArchiveWriter
        Set 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:
        setStreamSorter in interface IDocArchiveWriter
        Parameters:
        streamSorter - - the stream sorter
      • finish

        public void finish()
                    throws java.io.IOException
        Description copied from interface: IDocArchiveWriter
        This 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:
        finish in interface IDocArchiveWriter
        Throws:
        java.io.IOException
      • open

        public void open()
                  throws java.io.IOException
        Description copied from interface: IDocArchiveReader
        This functiona must be called before the reader is used. initialize the document archive. For example, the index stream mey be read into memory.
        Specified by:
        open in interface IDocArchiveReader
        Throws:
        java.io.IOException
      • getStream

        public RAInputStream getStream​(java.lang.String relativePath)
                                throws java.io.IOException
        Description copied from interface: IDocArchiveReader
        returns a sequential access file.
        Specified by:
        getStream in interface IDocArchiveReader
        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:
        java.io.IOException
      • listStreams

        public java.util.List<java.lang.String> listStreams​(java.lang.String relativeStoragePath)
                                                     throws java.io.IOException
        Specified by:
        listStreams in interface IDocArchiveReader
        Specified by:
        listStreams in interface IDocArchiveWriter
        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:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: IDocArchiveReader
        This function must be called after the reader is used. close the archive.
        Specified by:
        close in interface IDocArchiveReader
        Throws:
        java.io.IOException
      • isOpen

        public boolean isOpen()
      • flush

        public void flush()
                   throws java.io.IOException
        Description copied from interface: IDocArchiveWriter
        This function flushs all the buffers in the writer
        Specified by:
        flush in interface IDocArchiveWriter
        Throws:
        java.io.IOException
      • lock

        public java.lang.Object lock​(java.lang.String stream)
                              throws java.io.IOException
        Description copied from interface: IDocArchiveWriter
        try to lock the stream
        Specified by:
        lock in interface IDocArchiveReader
        Specified by:
        lock in interface IDocArchiveWriter
        Returns:
        the locker.
        Throws:
        java.io.IOException