private String getIndexName() { return definition.getIndexName(); }
protected String getIndexName() { return definition.getIndexName(); }
private String getIndexName() { return context.getDefinition().getIndexName(); } }
private String getIndexName() { return context.getDefinition().getIndexName(); } }
private String getIndexName() { return context.getDefinition().getIndexName(); } }
private static TikaConfigHolder initializeTikaConfig(@Nullable IndexDefinition definition) { ClassLoader current = Thread.currentThread().getContextClassLoader(); InputStream configStream = null; String configSource = null; try { Thread.currentThread().setContextClassLoader(FulltextIndexEditorContext.class.getClassLoader()); if (definition != null && definition.hasCustomTikaConfig()) { log.debug("[{}] Using custom tika config", definition.getIndexName()); configSource = "Custom config at " + definition.getIndexPath(); configStream = definition.getTikaConfig(); } else { URL configUrl = FulltextIndexEditorContext.class.getResource("tika-config.xml"); if (configUrl != null) { configSource = configUrl.toString(); configStream = configUrl.openStream(); } } if (configStream != null) { return new TikaConfigHolder(new TikaConfig(configStream), configSource); } } catch (TikaException | IOException | SAXException e) { log.warn("Tika configuration not available : " + configSource, e); } finally { IOUtils.closeQuietly(configStream); Thread.currentThread().setContextClassLoader(current); } return new TikaConfigHolder(TikaConfig.getDefaultConfig(), "Default Config"); }
if (indexName != null && indexName.first != null) { String name = indexName.first.getValue(Type.STRING); String thisName = definition.getIndexName(); if (thisName != null) { thisName = PathUtils.getName(thisName);
@Test public void indexNameIsIndexPath() throws Exception { NodeBuilder index = builder.child(INDEX_DEFINITIONS_NAME); newLucenePropertyIndexDefinition(index, "lucene", ImmutableSet.of("foo"), null); NodeState before = builder.getNodeState(); builder.setProperty("foo", "bar"); NodeState after = builder.getNodeState(); NodeState indexed = HOOK.processCommit(before, after, CommitInfo.EMPTY); String indexPath = "/oak:index/lucene"; IndexDefinition defn = new IndexDefinition(root, indexed.getChildNode("oak:index").getChildNode("lucene"), indexPath); assertEquals(indexPath, defn.getIndexName()); assertEquals(indexPath, defn.getIndexPath()); }