Global.helma.Search.prototype.getRAMDirectory (dir)
Returns a RAM directory object.

  • Parameter {File:
    | helma.File | java.io.File | String} dir Optional directory containing a Lucene index from which this RAM directory should be created.
  • Returns
    A RAM directory instance.
Sourcecode in /home/hannes/helma/modules/helma/Search.js:
177:   helma.Search.prototype.getRAMDirectory = function(dir) {
178:       if (dir != null) {
179:           var d;
180:           if (dir.constructor == String) {
181:               d = new java.io.File(dir);
182:           } else if (dir.constructor == File || dir.constructor == helma.File) {
183:               d = new java.io.File(dir.getAbsolutePath());
184:           } else if (!((d = dir) instanceof java.io.File)) {
185:               throw("helma.Search.getRAMDirectory(): " + dir + " is not a valid argument.");
186:          }
187:          if (!d.exists()) {
188:              throw("helma.Search.getRAMDirectory(): " + dir + " does not exist.");
189:          }
190:          return Packages.org.apache.lucene.store.RAMDirectory(d);
191:      }
192:      return Packages.org.apache.lucene.store.RAMDirectory();
193:  }