BeforeCompressFile Event
Marks the start of compression of a file.
Syntax
public class DefaultArchivewriterEventListener implements ArchivewriterEventListener { ... public void beforeCompressFile(ArchivewriterBeforeCompressFileEvent e) {} ... } public class ArchivewriterBeforeCompressFileEvent { public String path; public long fileSize; public int dataSource; }
Remarks
Subscribe to this event to be notified about the start of compression of an archive entry. The handler of this event is a good place to prepare the desired data source.
The Path parameter indicates the path to the extracted entry in the archive. The FileSize specifies the size of the file before compression. Use this event handler to adjust the data source if the file is to be loaded from a stream or buffer. The DataSource parameter indicates the type of the data media:
fdsFile (0) | The data will be taken from a file indicated by the entry's LocalPath setting. You can change this path in the handler of this event. |
fdsStream (1) | The file data will be taken from a stream assigned to FileStream property. |
fdsBuffer (2) | The data will be taken from a buffer attached to the FileData property. |
Use PrepareFile event to adjust the file data source on the fly.