public class CompoundFileWriter extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
static int |
FILE_STATE_DELETED
This state denotes that a file in the compound file is deleted.
|
static int |
FILE_STATE_NORMAL
This state denotes that a file in the compound file is normal
(i.e., NOT deleted).
|
| Constructor and Description |
|---|
CompoundFileWriter(String physicalFilename)
Create (if it doesn't exist) or append to (if it does exist)
a compound file.
|
| Modifier and Type | Method and Description |
|---|---|
CompoundDataOutput |
addFile(String name)
Add a file to the compound file.
|
void |
close()
Close the CompoundFileWriter.
|
void |
deleteFile(String name)
Delete a file with the given name.
|
void |
finishAddFile()
Finish adding a file to the compound file.
|
CompoundFileReader |
getCompoundFileReader()
Get the compoundFileReader associated with this compoundFileWriter.
|
public static final int FILE_STATE_NORMAL
public static final int FILE_STATE_DELETED
public CompoundFileWriter(String physicalFilename) throws IOException
physicalFilename - the compound file to write toIOException - problem opening the filepublic CompoundFileReader getCompoundFileReader()
public CompoundDataOutput addFile(String name) throws IOException
name - the internal filename (any string is valid)IOException - problem adding a filepublic void deleteFile(String name) throws IOException
name - the name of the file to delete.IOException - problem deleting the filepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - problem closing, likely the problem is with
finishAddFile(), if so the CompoundFile is probably un-usable.public void finishAddFile()
throws IOException
IOException - problem finishing addFile. The CompoundFile
is probably un-usable.Copyright © 2017 Campagne Laboratory. All rights reserved.