public class BaseDirectoryWrapper extends FilterDirectory
Modifier and Type | Field and Description |
---|---|
protected boolean |
isOpen |
in
Constructor and Description |
---|
BaseDirectoryWrapper(Directory delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the store.
|
void |
copy(Directory to,
String src,
String dest,
IOContext context)
Copies the file src to
Directory to under the new
file name dest. |
boolean |
getCheckIndexOnClose() |
boolean |
getCrossCheckTermVectorsOnClose() |
boolean |
isOpen() |
void |
setCheckIndexOnClose(boolean value)
Set whether or not checkindex should be run
on close
|
void |
setCrossCheckTermVectorsOnClose(boolean value) |
clearLock, createOutput, deleteFile, fileExists, fileLength, getDelegate, getLockFactory, getLockID, listAll, makeLock, openInput, setLockFactory, sync, toString
ensureOpen, openChecksumInput
public BaseDirectoryWrapper(Directory delegate)
public void close() throws IOException
Directory
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterDirectory
IOException
public boolean isOpen()
public void setCheckIndexOnClose(boolean value)
public boolean getCheckIndexOnClose()
public void setCrossCheckTermVectorsOnClose(boolean value)
public boolean getCrossCheckTermVectorsOnClose()
public void copy(Directory to, String src, String dest, IOContext context) throws IOException
Directory
Directory
to under the new
file name dest.
If you want to copy the entire source directory to the destination one, you can do so like this:
Directory to; // the directory to copy to for (String file : dir.listAll()) { dir.copy(to, file, newFile, IOContext.DEFAULT); // newFile can be either file, or a new name }
NOTE: this method does not check whether dest exist and will overwrite it if it does.
copy
in class Directory
IOException
Copyright © 2000–2016 The Apache Software Foundation. All rights reserved.