Methods Summary |
---|
public synchronized void | close()
if (stream == null)
throw new IOException("Already closed");
entries.clear();
stream.close();
stream = null;
|
public org.apache.lucene.store.OutputStream | createFile(java.lang.String name)Creates a new, empty file in the directory with the given name.
Returns a stream writing this file.
throw new UnsupportedOperationException();
|
public void | deleteFile(java.lang.String name)Removes an existing file in the directory.
throw new UnsupportedOperationException();
|
public boolean | fileExists(java.lang.String name)Returns true iff a file with the given name exists.
return entries.containsKey(name);
|
public long | fileLength(java.lang.String name)Returns the length of a file in the directory.
FileEntry e = (FileEntry) entries.get(name);
if (e == null)
throw new IOException("File " + name + " does not exist");
return e.length;
|
public long | fileModified(java.lang.String name)Returns the time the named file was last modified.
return directory.fileModified(fileName);
|
public org.apache.lucene.store.Directory | getDirectory()
return directory;
|
public java.lang.String | getName()
return fileName;
|
public java.lang.String[] | list()Returns an array of strings, one for each file in the directory.
String res[] = new String[entries.size()];
return (String[]) entries.keySet().toArray(res);
|
public org.apache.lucene.store.Lock | makeLock(java.lang.String name)Construct a {@link Lock}.
throw new UnsupportedOperationException();
|
public synchronized org.apache.lucene.store.InputStream | openFile(java.lang.String id)
if (stream == null)
throw new IOException("Stream closed");
FileEntry entry = (FileEntry) entries.get(id);
if (entry == null)
throw new IOException("No sub-file with id " + id + " found");
return new CSInputStream(stream, entry.offset, entry.length);
|
public void | renameFile(java.lang.String from, java.lang.String to)Renames an existing file in the directory.
If a file already exists with the new name, then it is replaced.
This replacement should be atomic.
throw new UnsupportedOperationException();
|
public void | touchFile(java.lang.String name)Set the modified time of an existing file to now.
directory.touchFile(fileName);
|