Package org.eclipse.birt.core.archive

# Class FolderArchiveReader

java.lang.Object
org.eclipse.birt.core.archive.FolderArchiveReader

All Implemented Interfaces:
  `IDocArchiveReader`

public class FolderArchiveReader extends Object implements IDocArchiveReader

## Constructor Summary

Constructors
Constructor
Description
`FolderArchiveReader(String folderName)`
`FolderArchiveReader(String folderName, boolean contentEscape)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
This function must be called after the reader is used.
`boolean`
`exists(String relativePath)`
`RAInputStream`
`getInputStream(String relativePath)`
`String`
`getName()`
return the folder name as the report archive name
`RAInputStream`
`getStream(String relativePath)`
returns a sequential access file.
`List<String>`
`listAllStreams()`
get all the stream in the archive file.
`List<String>`
`listStreams(String relativeStoragePath)`
return a list of strings which are the relative path of streams
`Object`
`lock(String stream)`
try to lock the stream
`void`
`open()`
This functiona must be called before the reader is used.
`void`
`unlock(Object lock)`
unlock the stream locked by the object.

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

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

## Constructor Details

### FolderArchiveReader

public FolderArchiveReader(String folderName, boolean contentEscape) throws IOException

Parameters:
  `folderName` -
  `contentEscape` - old document should be false.
Throws:
  `IOException`

### FolderArchiveReader

public FolderArchiveReader(String folderName) throws IOException

Parameters:
  `folderName` - - the absolute name of the folder archive
Throws:
  `IOException`

## Method Details

### getName

public String getName()
return the folder name as the report archive name

Specified by:
  `getName` in interface `IDocArchiveReader`
Returns:
  the archive name

### open

public void open()
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`

### close

public void close() throws 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:
  `IOException`

### getStream

public RAInputStream getStream(String relativePath) throws 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:
  `IOException`

### getInputStream

public RAInputStream getInputStream(String relativePath) throws IOException

Specified by:
  `getInputStream` in interface `IDocArchiveReader`
Throws:
  `IOException`

### exists

public boolean exists(String relativePath)

Specified by:
  `exists` 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:
  whether the stream exist

### listStreams

public List<String> listStreams(String relativeStoragePath) throws IOException
return a list of strings which are the relative path of streams

Specified by:
  `listStreams` in interface `IDocArchiveReader`
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

public List<String> listAllStreams() throws IOException
Description copied from interface: `IDocArchiveReader`
get all the stream in the archive file.

Specified by:
  `listAllStreams` in interface `IDocArchiveReader`
Returns:
Throws:
  `IOException`

### lock

public Object lock(String stream) throws IOException
Description copied from interface: `IDocArchiveReader`
try to lock the stream

Specified by:
  `lock` in interface `IDocArchiveReader`
Parameters:
  `stream` -
Returns:
  the locker.
Throws:
  `IOException`

### unlock

public void unlock(Object lock)
Description copied from interface: `IDocArchiveReader`
unlock the stream locked by the object.

Specified by:
  `unlock` in interface `IDocArchiveReader`
Parameters:
  `lock` - object returned by the lock().