作者:用户2ng6zjfjen | 来源:互联网 | 2023-09-24 09:36
本文整理了Java中org.apache.tika.mime.MediaType.text()
方法的一些代码示例,展示了MediaType.text()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MediaType.text()
方法的具体详情如下:
包路径:org.apache.tika.mime.MediaType
类名称:MediaType
方法名:text
MediaType.text介绍
暂无
代码示例
代码示例来源:origin: apache/jackrabbit-oak
@Override
public MediaType getType() {
return MediaType.text("html");
}
代码示例来源:origin: org.apache.jackrabbit/oak-http
@Override
public MediaType getType() {
return MediaType.text("html");
}
代码示例来源:origin: apache/tika
@Test
public void testTIKA2237() throws IOException {
Metadata metadata = new Metadata();
metadata.add(Metadata.CONTENT_TYPE, MediaType.text("Javascript").toString());
InputStream input = new ByteArrayInputStream(("function() {};\n" +
"try {\n" +
" window.location = 'index.html';\n" +
"} catch (e) {\n" +
" console.log(e);\n" +
"}").getBytes(StandardCharsets.UTF_8));
MediaType detect = new ProbabilisticMimeDetectionSelector().detect(input, metadata);
assertEquals(MediaType.application("Javascript"), detect);
}
}
代码示例来源:origin: io.committed.krill/krill
@Override
public Set getSupportedTypes(final ParseContext context) {
return Sets.newHashSet(MediaType.text("csv"), MediaType.text("tab-separated-values"));
}
}
代码示例来源:origin: io.committed.krill/krill
"application/vnd.ms-powerpoint.slideshow.macroEnabled.12");
addProcessor(new PdfFormatProcessor(), MediaType.application("pdf").toString());
addProcessor(new HtmlFormatProcessor(), MediaType.text("html").toString(),
MediaType.application("xhtml+xml").toString());
addProcessor(new RtfFormatProcessor(), MediaType.application("rtf").toString());