Search in sources :

Example 11 with StreamSource

use of org.apache.stanbol.enhancer.servicesapi.impl.StreamSource in project stanbol by apache.

the class TikaEngineTest method createContentItem.

private ContentItem createContentItem(String resourceName, String contentType) throws IOException {
    InputStream in = TikaEngineTest.class.getClassLoader().getResourceAsStream(resourceName);
    assertNotNull(in);
    return ciFactory.createContentItem(new StreamSource(in, contentType));
}
Also used : InputStream(java.io.InputStream) StreamSource(org.apache.stanbol.enhancer.servicesapi.impl.StreamSource)

Aggregations

StreamSource (org.apache.stanbol.enhancer.servicesapi.impl.StreamSource)11 ByteArrayInputStream (java.io.ByteArrayInputStream)8 Test (org.junit.Test)7 ContentSource (org.apache.stanbol.enhancer.servicesapi.ContentSource)6 ByteArraySource (org.apache.stanbol.enhancer.servicesapi.impl.ByteArraySource)4 Blob (org.apache.stanbol.enhancer.servicesapi.Blob)3 ContentItem (org.apache.stanbol.enhancer.servicesapi.ContentItem)3 InputStream (java.io.InputStream)2 MediaType (javax.ws.rs.core.MediaType)2 IRI (org.apache.clerezza.commons.rdf.IRI)2 FileItemIterator (org.apache.commons.fileupload.FileItemIterator)2 FileItemStream (org.apache.commons.fileupload.FileItemStream)2 ContentItemFactory (org.apache.stanbol.enhancer.servicesapi.ContentItemFactory)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 URISyntaxException (java.net.URISyntaxException)1 Charset (java.nio.charset.Charset)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1