Global.helma.Search.prototype.getDirectory (dir, create)
Returns an instance of org.apache.lucene.store.FSDirectory

  • Parameter {File:
    | helma.File | java.io.File | String} dir The directory where the index is located or should be created at.
  • Returns
    The index directory.
Sourcecode in /home/hannes/helma/modules/helma/Search.js:
154:   helma.Search.prototype.getDirectory = function(dir, create) {
155:       if (!dir) {
156:           throw("helma.Search.getDirectory(): insufficient arguments.");
157:       }
158:       var d;
159:       if (dir.constructor == String) {
160:           d = new java.io.File(dir);
161:       } else if (dir.constructor == File || dir.constructor == helma.File) {
162:           d = new java.io.File(dir.getAbsolutePath());
163:      } else if (!((d = dir) instanceof java.io.File)) {
164:          throw("helma.Search.getDirectory(): " + dir + " is not a valid argument.");
165:      }
166:      return Packages.org.apache.lucene.store.FSDirectory.getDirectory(d,
167:                 create == true ? true : !d.exists());
168:  }