adeppathondur / luke

Automatically exported from code.google.com/p/luke
0 stars 0 forks source link

Custom directory implementation must be inherited from FSDirectory #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open directory and type custom implementation class name for Directory

What is the expected output? What do you see instead?
Luke should open index with specified directory.
Instead error message is displayed, because directory is opened with FSDirecory

What version of the product are you using? On what operating system?
1.0.1

Please provide any additional information below.
I've provided svn diff to patch the problem. Basicaly replace FSDirectory
type with Directory in openDirectory

Original issue reported on code.google.com by mitja.le...@gmail.com on 30 May 2010 at 7:36

Attachments:

GoogleCodeExporter commented 9 years ago
I'v encountered the same error message, even the custom directory 
implementation is inherited from FSDirectory. Below is my solution to this 
problem:
  In the "Luke.java" file, change the code lines in "public void openOk(Object dialog)" method as follow,

    Object dirImpl = getSelectedItem(find(dialog, "dirImpl"));
    String dirClass = null;
    if (dirImpl == null) {
  -     dirClass = FSDirectory.class.getName();
  +     dirClass = getString(find(dialog, "dirImpl"), "text");
  +     try {
  +         Class.forName(dirClass);
  +     } catch (Exception e) {
  +         errorMsg("Invalid directory implementation class: " + dirClass);
  +         return;
  +     }
    } else { ...

Original comment by eggw...@hotmail.com on 10 Jun 2010 at 10:13

GoogleCodeExporter commented 9 years ago
Patch applied to branch-3x (rev. 58) and trunk (rev. 59). Thank you!

Original comment by sig...@gmail.com on 27 Apr 2011 at 10:49