@Override public String getContentType() { return stream.getContentType(); } };
public String getContentType() { return contentStream[0].getContentType(); }
@Override public Header getContentType() { return new BasicHeader("Content-Type", contentStream[0].getContentType()); }
@Override public Header getContentType() { return new BasicHeader("Content-Type", contentStream[0].getContentType()); }
@Override public Header getContentType() { return new BasicHeader("Content-Type", contentStream[0].getContentType()); }
final String contentType = stream.getContentType() != null && !"application/xml".equals(stream.getContentType()) && !"application/json".equals(stream.getContentType()) ? stream.getContentType() : request.getParams().get(UpdateParams.ASSUME_CONTENT_TYPE);
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) { Object obj = response.getValues().get( CONTENT ); if( obj != null && (obj instanceof ContentStream ) ) { return ((ContentStream)obj).getContentType(); } return getBaseWriter( request ).getContentType( request, response ); }
/** * Read commands from request streams * * @param streams the streams * @param resp solr query response * @param singletonCommands , commands that cannot be repeated * @return parsed list of commands * @throws IOException if there is an error while parsing the stream */ public static List<CommandOperation> readCommands(Iterable<ContentStream> streams, NamedList resp, Set<String> singletonCommands) throws IOException { if (streams == null) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "missing content stream"); } ArrayList<CommandOperation> ops = new ArrayList<>(); for (ContentStream stream : streams) { if ("application/javabin".equals(stream.getContentType())) { ops.addAll(parse(stream.getStream(), singletonCommands)); } else { ops.addAll(parse(stream.getReader(), singletonCommands)); } } List<Map> errList = CommandOperation.captureErrors(ops); if (!errList.isEmpty()) { resp.add(CommandOperation.ERR_MSGS, errList); return null; } return ops; }
String contentType = content.getContentType(); if (contentType == null) {
String contentType = stream.getContentType();
parts.add(new PartBase(c.getName(), c.getContentType(), charSet, transferEncoding) { @Override post.setRequestEntity(new InputStreamRequestEntity(contentStream[0].getStream(), contentStream[0].getContentType()));
@Override public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException { // Show params rsp.add( "params", req.getParams().toNamedList() ); // Write the streams... if( req.getContentStreams() != null ) { ArrayList streams = new ArrayList(); // Cycle through each stream for( ContentStream content : req.getContentStreams() ) { NamedList<Object> stream = new SimpleOrderedMap<Object>(); stream.add( "name", content.getName() ); stream.add( "sourceInfo", content.getSourceInfo() ); stream.add( "size", content.getSize() ); stream.add( "contentType", content.getContentType() ); stream.add( "stream", IOUtils.toString( content.getStream() ) ); streams.add( stream ); } rsp.add( "streams", streams ); } rsp.add("context", req.getContext()); }
String contentType = content.getContentType(); if (contentType == null) {
if(stream.getContentType() != null) { metadata.add(HttpHeaders.CONTENT_TYPE, stream.getContentType()); metadata.add(ExtractingMetadataConstants.STREAM_SOURCE_INFO, stream.getSourceInfo()); metadata.add(ExtractingMetadataConstants.STREAM_SIZE, String.valueOf(stream.getSize())); metadata.add(ExtractingMetadataConstants.STREAM_CONTENT_TYPE, stream.getContentType()); String charset = ContentStreamBase.getCharsetFromContentType(stream.getContentType()); if(charset != null){ metadata.add(HttpHeaders.CONTENT_ENCODING, charset);
metadata.add(ExtractingMetadataConstants.STREAM_SOURCE_INFO, stream.getSourceInfo()); metadata.add(ExtractingMetadataConstants.STREAM_SIZE, String.valueOf(stream.getSize())); metadata.add(ExtractingMetadataConstants.STREAM_CONTENT_TYPE, stream.getContentType());