Tabnine Logo
ContentStreamBase$StringStream.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.solr.common.util.ContentStreamBase$StringStream
constructor

Best Java code snippets using org.apache.solr.common.util.ContentStreamBase$StringStream.<init> (Showing top 17 results out of 315)

origin: apache/storm

private SolrRequest createtSolrRequest(String json) {
  final ContentStreamUpdateRequest request = new ContentStreamUpdateRequest(jsonUpdateUrl);
  final ContentStream cs = new ContentStreamBase.StringStream(json, CONTENT_TYPE);
  request.addContentStream(cs);
  if (logger.isDebugEnabled()) {
    logger.debug("Request generated with JSON: " + json);
  }
  return request;
}
origin: spring-projects/spring-data-solr

@Override
public StringStream parse(Object content) {
  JsonNode node = mapper.convertValue(content, JsonNode.class);
  return new StringStream(node.toString());
}
origin: org.apache.solr/solr-solrj

/**
 * Take a string and make it an iterable ContentStream
 */
public static Collection<ContentStream> toContentStreams( final String str, final String contentType )
{
 if( str == null )
  return null;
 ArrayList<ContentStream> streams = new ArrayList<>( 1 );
 ContentStreamBase ccc = new ContentStreamBase.StringStream( str );
 ccc.setContentType( contentType );
 streams.add( ccc );
 return streams;
}
origin: org.apache.solr/solr-dataimporthandler

rawParams.set(CommonParams.WT, "raw");
req.setParams(rawParams);
ContentStreamBase content = new ContentStreamBase.StringStream(dataConfig);
rsp.add(RawResponseWriter.CONTENT, content);
origin: org.dspace.dependencies.solr/dspace-solr-server

streams.add( new ContentStreamBase.StringStream( body ) );
origin: org.dspace.dependencies.solr/dspace-solr-server

if( strs != null ) {
 for( final String body : strs ) {
  ContentStreamBase stream = new ContentStreamBase.StringStream( body );
  if( contentType != null ) {
   stream.setContentType( contentType );
origin: com.hynnet/solr-solrj

public ContentStream getContentStream(UpdateRequest req) throws IOException {
 return new ContentStreamBase.StringStream(req.getXML());
}
origin: org.apache.solr/solr-test-framework

public static void addDoc(String doc, String updateRequestProcessorChain) throws Exception {
 Map<String, String[]> params = new HashMap<>();
 MultiMapSolrParams mmparams = new MultiMapSolrParams(params);
 params.put(UpdateParams.UPDATE_CHAIN, new String[]{updateRequestProcessorChain});
 SolrQueryRequestBase req = new SolrQueryRequestBase(h.getCore(),
   (SolrParams) mmparams) {
 };
 UpdateRequestHandler handler = new UpdateRequestHandler();
 handler.init(null);
 ArrayList<ContentStream> streams = new ArrayList<>(2);
 streams.add(new ContentStreamBase.StringStream(doc));
 req.setContentStreams(streams);
 handler.handleRequestBody(req, new SolrQueryResponse());
 req.close();
}
origin: com.hynnet/solr-solrj

/**
 * Take a string and make it an iterable ContentStream
 */
public static Collection<ContentStream> toContentStreams( final String str, final String contentType )
{
 if( str == null )
  return null;
 ArrayList<ContentStream> streams = new ArrayList<>( 1 );
 ContentStreamBase ccc = new ContentStreamBase.StringStream( str );
 ccc.setContentType( contentType );
 streams.add( ccc );
 return streams;
}
origin: com.hynnet/solr-solrj

@Override
public Collection<ContentStream> getContentStreams() throws IOException {
 CharArr json = new CharArr();
 new SchemaRequestJSONWriter(json).write(getRequestParameters());
 return Collections.<ContentStream>singletonList(new ContentStreamBase.StringStream(json.toString()));
}
origin: org.dspace.dependencies.solr/dspace-solr-solrj

public ContentStream getContentStream(UpdateRequest req) throws IOException {
 return new ContentStreamBase.StringStream(req.getXML());
}
origin: g00glen00b/spring-samples

private ContentStreamUpdateRequest updateRequest(HtmlResource htmlFile) {
  try {
    ContentStreamUpdateRequest updateRequest = new ContentStreamUpdateRequest(configurationProperties.getExtractPath());
    updateRequest.addContentStream(new ContentStreamBase.StringStream(htmlFile.getHtml(), "text/html;charset=UTF-8"));
    updateRequest.setParam(FILE_ID_LITERAL, htmlFile.getResource().getFile().getAbsolutePath());
    updateRequest.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
    return updateRequest;
  } catch (IOException ex) {
    throw new SolrItemWriterException("Could not retrieve filename", ex);
  }
}
origin: org.dspace.dependencies.solr/dspace-solr-solrj

/**
 * Take a string and make it an iterable ContentStream
 */
public static Collection<ContentStream> toContentStreams( final String str, final String contentType )
{
 if( str == null )
  return null;
 ArrayList<ContentStream> streams = new ArrayList<ContentStream>( 1 );
 ContentStreamBase ccc = new ContentStreamBase.StringStream( str );
 ccc.setContentType( contentType );
 streams.add( ccc );
 return streams;
}
origin: hortonworks/streamline

  private SolrRequest<UpdateResponse> createSolrRequest(String json) {
    final ContentStreamUpdateRequest request = new ContentStreamUpdateRequest(jsonUpdateUrl);
    final ContentStream cs = new ContentStreamBase.StringStream(json, CONTENT_TYPE);
    request.addContentStream(cs);
    LOG.debug("Request generated with JSON: {}", json);
    return request;
  }
}
origin: org.apache.storm/storm-solr

private SolrRequest createtSolrRequest(String json) {
  final ContentStreamUpdateRequest request = new ContentStreamUpdateRequest(jsonUpdateUrl);
  final ContentStream cs = new ContentStreamBase.StringStream(json, CONTENT_TYPE);
  request.addContentStream(cs);
  if (logger.isDebugEnabled()) {
    logger.debug("Request generated with JSON: " + json);
  }
  return request;
}
origin: org.apache.stanbol/org.apache.stanbol.commons.solr.core

public StreamQueryRequest(SolrQuery q) {
  super(q, METHOD.POST);
  String[] bodies = q.remove(CommonParams.STREAM_BODY);
  if (bodies != null && bodies.length > 0) {
    String body = StringUtils.join(bodies, " ");
    this.contentStream = new StringStream(body);
  }
}
origin: apache/stanbol

public StreamQueryRequest(SolrQuery q) {
  super(q, METHOD.POST);
  String[] bodies = q.remove(CommonParams.STREAM_BODY);
  if (bodies != null && bodies.length > 0) {
    String body = StringUtils.join(bodies, " ");
    this.contentStream = new StringStream(body);
  }
}
org.apache.solr.common.utilContentStreamBase$StringStream<init>

Popular methods of ContentStreamBase$StringStream

  • getCharsetFromContentType
  • getStream
  • detect

Popular in Java

  • Creating JSON documents from java classes using gson
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JCheckBox (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now