|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.creole.annic.apache.lucene.store.Directory
gate.creole.annic.apache.lucene.index.CompoundFileReader
class CompoundFileReader
Class for accessing a compound stream. This class implements a directory, but is limited to only read operations. Directory methods that would normally modify data throw an exception.
| Nested Class Summary | |
|---|---|
(package private) static class |
CompoundFileReader.CSInputStream
Implementation of an InputStream that reads from a portion of the compound file. |
private static class |
CompoundFileReader.FileEntry
|
| Field Summary | |
|---|---|
private Directory |
directory
|
private HashMap |
entries
|
private String |
fileName
|
private boolean |
open
|
private InputStream |
stream
|
| Constructor Summary | |
|---|---|
CompoundFileReader(Directory dir,
String name)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the store. |
OutputStream |
createFile(String name)
Creates a new, empty file in the directory with the given name. |
void |
deleteFile(String name)
Removes an existing file in the directory. |
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. |
long |
fileModified(String name)
Returns the time the named file was last modified. |
Directory |
getDirectory()
|
String |
getName()
|
String[] |
list()
Returns an array of strings, one for each file in the directory. |
Lock |
makeLock(String name)
Construct a Lock. |
InputStream |
openFile(String id)
Returns a stream reading an existing file. |
void |
renameFile(String from,
String to)
Renames an existing file in the directory. |
void |
touchFile(String name)
Set the modified time of an existing file to now. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Directory directory
private String fileName
private boolean open
private InputStream stream
private HashMap entries
| Constructor Detail |
|---|
public CompoundFileReader(Directory dir,
String name)
throws IOException
IOException| Method Detail |
|---|
public Directory getDirectory()
public String getName()
public void close()
throws IOException
Directory
close in class DirectoryIOException
public InputStream openFile(String id)
throws IOException
Directory
openFile in class DirectoryIOExceptionpublic String[] list()
list in class Directorypublic boolean fileExists(String name)
fileExists in class Directory
public long fileModified(String name)
throws IOException
fileModified in class DirectoryIOException
public void touchFile(String name)
throws IOException
touchFile in class DirectoryIOExceptionpublic void deleteFile(String name)
deleteFile in class Directory
public void renameFile(String from,
String to)
renameFile in class Directory
public long fileLength(String name)
throws IOException
fileLength in class DirectoryIOExceptionpublic OutputStream createFile(String name)
createFile in class Directorypublic Lock makeLock(String name)
Lock.
makeLock in class Directoryname - the name of the lock file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||