public class CompoundFileReader extends Object implements Closeable
| Constructor and Description |
|---|
CompoundFileReader(String physicalFilename)
Create (if it doesn't exist) or open to (if it does exist)
a compound file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the compound file.
|
boolean |
containsFile(String name)
Returns true of a file with the specified name exists in this
compound file.
|
Collection<CompoundDirectoryEntry> |
getDirectory()
Get the complete directory.
|
CompoundDirectoryEntry |
getDirectoryEntry(String name)
Get the directory entry for a specific file or null
of a file with that name is not in the directory.
|
Set<String> |
getFileNames()
Get the set of non-deleted filenames in the compound file.
|
long |
getFileSize(String name)
Get the file size for a specific file in the compound file.
|
long |
getTotalNumberOfFiles()
Get the total number of files stored in the compound file, included deleted files.
|
CompoundDataInput |
readFile(String name)
Read a file from the compound file.
|
void |
scanDirectory()
Force a re-scan of the contents of the compound file.
|
public CompoundFileReader(String physicalFilename) throws IOException
physicalFilename - the compound file to read fromIOException - problem opening the filepublic long getTotalNumberOfFiles()
public CompoundDataInput readFile(String name) throws IOException
name - the name of the compound file to readIOException - problem reading the filepublic Set<String> getFileNames()
public long getFileSize(String name) throws FileNotFoundException
name - the name of the file to get the size forFileNotFoundException - if the file named does not exist in the compound filepublic void scanDirectory()
throws IOException
IOException - problem reading the compound filepublic boolean containsFile(String name)
name - the name of the file to check forpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - error closing the compound filepublic CompoundDirectoryEntry getDirectoryEntry(String name)
name - filename to get the directory entry forpublic Collection<CompoundDirectoryEntry> getDirectory()
Copyright © 2018 Campagne Laboratory. All rights reserved.