public final class CompoundFileDirectory extends BaseDirectory
All files belonging to a segment have the same name with varying extensions.
The extensions correspond to the different file formats used by the Codec.
When using the Compound File format these files are collapsed into a
single .cfs file (except for the LiveDocsFormat, with a
corresponding .cfe file indexing its sub-files.
Files:
Description:
CodecHeaderVIntUInt64StringCodecFooterNotes:
| Modifier and Type | Class and Description |
|---|---|
static class |
CompoundFileDirectory.FileEntry
Offset/Length for a slice inside of a compound file
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
readBufferSize |
isOpen, lockFactory| Constructor and Description |
|---|
CompoundFileDirectory(Directory directory,
String fileName,
IOContext context,
boolean openForWrite)
Create a new CompoundFileDirectory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the store.
|
IndexOutput |
createOutput(String name,
IOContext context)
Creates a new, empty file in the directory with the given name.
|
void |
deleteFile(String name)
Not implemented
|
boolean |
fileExists(String name)
Returns true iff a file with the given name exists.
|
long |
fileLength(String name)
Returns the length of a file in the directory.
|
Directory |
getDirectory() |
String |
getName() |
String[] |
listAll()
Returns an array of strings, one for each file in the directory.
|
Lock |
makeLock(String name)
Not implemented
|
IndexInput |
openInput(String name,
IOContext context)
Returns a stream reading an existing file, with the
specified read buffer size.
|
void |
renameFile(String from,
String to)
Not implemented
|
void |
sync(Collection<String> names)
Ensure that any writes to these files are moved to
stable storage.
|
String |
toString() |
clearLock, ensureOpen, getLockFactory, setLockFactorycopy, getLockID, openChecksumInputpublic CompoundFileDirectory(Directory directory, String fileName, IOContext context, boolean openForWrite) throws IOException
IOExceptionpublic Directory getDirectory()
public String getName()
public void close()
throws IOException
Directoryclose in interface Closeableclose in interface AutoCloseableclose in class DirectoryIOExceptionpublic IndexInput openInput(String name, IOContext context) throws IOException
DirectoryFSDirectory and CompoundFileDirectory.
Throws FileNotFoundException or NoSuchFileException
if the file does not exist.
openInput in class DirectoryIOExceptionpublic String[] listAll()
public boolean fileExists(String name)
fileExists in class Directorypublic void deleteFile(String name)
deleteFile in class DirectoryUnsupportedOperationException - always: not supported by CFSpublic void renameFile(String from, String to)
UnsupportedOperationException - always: not supported by CFSpublic long fileLength(String name) throws IOException
fileLength in class Directoryname - the name of the file for which to return the length.IOException - if the file does not existpublic IndexOutput createOutput(String name, IOContext context) throws IOException
DirectorycreateOutput in class DirectoryIOExceptionpublic void sync(Collection<String> names)
Directorypublic Lock makeLock(String name)
makeLock in class BaseDirectoryname - the name of the lock fileUnsupportedOperationException - always: not supported by CFSCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.