org.apache.tika.Tika.toString()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(217)

本文整理了Java中org.apache.tika.Tika.toString()方法的一些代码示例,展示了Tika.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tika.toString()方法的具体详情如下:
包路径:org.apache.tika.Tika
类名称:Tika
方法名:toString

Tika.toString介绍

暂无

代码示例

代码示例来源:origin: apache/tika

@GET
  @Produces("text/plain")
  public String getVersion() {
    TikaResource.checkIsOperating();
    return tika.toString();
  }
}

代码示例来源:origin: apache/tika

private void version() {
  System.out.println(new Tika().toString());
}

代码示例来源:origin: apache/tika

@GET
@Produces("text/plain")
public String getWelcomePlain() {
  TikaResource.checkIsOperating();
  StringBuffer text = new StringBuffer();
  text.append(tika.toString());
  text.append("\n");
  text.append("For endpoints, please see ");
  text.append(DOCS_URL);
  text.append("\n\n");
  for (Endpoint e : identifyEndpoints()) {
    text.append(e.httpMethod);
    text.append(" ");
    text.append(e.path);
    text.append("\n");
    for (String produces : e.produces) {
      text.append(" => ");
      text.append(produces);
      text.append("\n");
    }
  }
  return text.toString();
}

代码示例来源:origin: apache/tika

String tikaVersion = tika.toString();

代码示例来源:origin: apache/tika

@Test
public void testToString() {
  String version = new Tika().toString();
  assertNotNull(version);
  assertTrue(version.matches(
      "Apache Tika \\d+\\.\\d+(\\.\\d+)?(-SNAPSHOT)?"));
}

代码示例来源:origin: apache/tika

@Test
  public void testGetVersion() throws Exception {
    Response response = WebClient
        .create(endPoint + VERSION_PATH)
        .type("text/plain")
        .accept("text/plain")
        .get();

    assertEquals(new Tika().toString(),
        getStringFromInputStream((InputStream) response.getEntity()));
  }
}

代码示例来源:origin: fr.sii.ogham/ogham-core

@Override
public String toString() {
  StringBuilder builder = new StringBuilder();
  builder.append("TikaProvider [tika=").append(tika.toString()).append("]");
  return builder.toString();
}

代码示例来源:origin: apache/tika

@Test
public void testGetTextWelcome() throws Exception {
  Response response = WebClient
      .create(endPoint + WELCOME_PATH)
      .type("text/plain")
      .accept("text/plain")
      .get();
  String text = getStringFromInputStream((InputStream) response.getEntity());
  assertContains(new Tika().toString(), text);
  // Check our details were found
  assertContains("GET " + WELCOME_PATH, text);
  assertContains("=> text/plain", text);
  // Check that the Tika Version details come through too
  assertContains("GET " + VERSION_PATH, text);
}

代码示例来源:origin: apache/tika

@Test
public void testGetHTMLWelcome() throws Exception {
  String html  = WebClient
      .create(endPoint + WELCOME_PATH)
      .type("text/html")
      .accept("text/html")
      .get(String.class);
  assertContains(new Tika().toString(), html);
  assertContains("href=\"http", html);
  // Check our details were found
  assertContains("GET", html);
  assertContains(WELCOME_PATH, html);
  assertContains("text/plain", html);
  // Check that the Tika Version details come through too
  assertContains(VERSION_PATH, html);
}

相关文章