mirror of https://github.com/apache/lucene.git
LUCENE-10287: Re-add abstract FSDirectory class as a supported directory (#522)
This commit is contained in:
parent
8525356c8a
commit
35eff443a7
|
@ -55,9 +55,8 @@ import org.apache.lucene.luke.app.desktop.util.FontUtils;
|
|||
import org.apache.lucene.luke.app.desktop.util.MessageUtils;
|
||||
import org.apache.lucene.luke.app.desktop.util.StyleConstants;
|
||||
import org.apache.lucene.luke.models.LukeException;
|
||||
import org.apache.lucene.luke.models.util.IndexUtils;
|
||||
import org.apache.lucene.luke.util.LoggerFactory;
|
||||
import org.apache.lucene.store.MMapDirectory;
|
||||
import org.apache.lucene.store.NIOFSDirectory;
|
||||
import org.apache.lucene.util.NamedThreadFactory;
|
||||
import org.apache.lucene.util.SuppressForbidden;
|
||||
|
||||
|
@ -127,7 +126,7 @@ public final class OpenIndexDialogFactory implements DialogOpener.DialogFactory
|
|||
Executors.newFixedThreadPool(1, new NamedThreadFactory("load-directory-types"));
|
||||
executorService.execute(
|
||||
() -> {
|
||||
for (String clazzName : supportedDirImpls()) {
|
||||
for (String clazzName : IndexUtils.supportedDirectoryImpls()) {
|
||||
dirImplCombo.addItem(clazzName);
|
||||
}
|
||||
});
|
||||
|
@ -254,10 +253,6 @@ public final class OpenIndexDialogFactory implements DialogOpener.DialogFactory
|
|||
return panel;
|
||||
}
|
||||
|
||||
private String[] supportedDirImpls() {
|
||||
return new String[] {MMapDirectory.class.getName(), NIOFSDirectory.class.getName()};
|
||||
}
|
||||
|
||||
private JPanel buttons() {
|
||||
JPanel panel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
|
||||
panel.setOpaque(false);
|
||||
|
|
|
@ -47,6 +47,8 @@ import org.apache.lucene.store.FSDirectory;
|
|||
import org.apache.lucene.store.IOContext;
|
||||
import org.apache.lucene.store.IndexInput;
|
||||
import org.apache.lucene.store.LockFactory;
|
||||
import org.apache.lucene.store.MMapDirectory;
|
||||
import org.apache.lucene.store.NIOFSDirectory;
|
||||
import org.apache.lucene.util.Bits;
|
||||
|
||||
/**
|
||||
|
@ -108,6 +110,17 @@ public final class IndexUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns supported {@link Directory} implementations.
|
||||
*
|
||||
* @return class names of supported directory implementation
|
||||
*/
|
||||
public static String[] supportedDirectoryImpls() {
|
||||
return new String[] {
|
||||
FSDirectory.class.getName(), MMapDirectory.class.getName(), NIOFSDirectory.class.getName()
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens an index directory for given index path.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue