Ejemplo n.º 1
0
  Cache openTextCache(String table, String source, boolean readOnlyData, boolean reversed)
      throws SQLException {

    closeTextCache(table);

    if (pProperties.getProperty("textdb.allow_full_path", "false").equals("false")) {
      if (source.indexOf("..") != -1) {
        throw (Trace.error(Trace.ACCESS_IS_DENIED, source));
      }

      String path = new File(new File(sName).getAbsolutePath()).getParent();

      if (path != null) {
        source = path + File.separator + source;
      }
    }

    String prefix = "textdb." + table.toLowerCase() + ".";
    TextCache c;

    if (reversed) {
      c = new ReverseTextCache(source, prefix, dDatabase);
    } else {
      c = new TextCache(source, prefix, dDatabase);
    }

    c.open(readOnlyData || bReadOnly);
    textCacheList.put(table, c);

    return (c);
  }
Ejemplo n.º 2
0
 /** Closes the TextCache object. */
 void closeTextCache(Table table) throws HsqlException {
   lLog.closeTextCache(table);
 }