return produceMetadata(is, httpHeaders.getRequestHeaders(), info);
}
private StreamingOutput produceMetadata(InputStream is, MultivaluedMap<String, String> httpHeaders, UriInfo info) throws Exception {
final Metadata metadata = new Metadata();
AutoDetectParser parser = TikaResource.createParser();
TikaResource.fillMetadata(parser, metadata, httpHeaders);
TikaResource.logRequest(logger, info, metadata);
parser.parse(is, new DefaultHandler(), metadata);
return new StreamingOutput() {
public void write(OutputStream outputStream) throws IOException, WebApplicationException {
metadataToCsv(metadata, outputStream);
}