Tabnine Logo
ContentStreamBase$StringStream
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.apache.solr.common.util.ContentStreamBase$StringStream (Showing top 20 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: 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: 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

public ContentStream getContentStream(UpdateRequest req) throws IOException {
 return new ContentStreamBase.StringStream(req.getXML());
}
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: org.dspace.dependencies.solr/dspace-solr-solrj

public ContentStream getContentStream(UpdateRequest req) throws IOException {
 return new ContentStreamBase.StringStream(req.getXML());
}
origin: com.hynnet/solr-solrj

public StringStream( String str ) {
 this(str, detect(str));
}
origin: org.apache.solr/solr-solrj

public StringStream( String str ) {
 this(str, detect(str));
}
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: 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: 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.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: org.apache.solr/solr-common

 /**
  * If an charset is defined (by the contentType) use that, otherwise 
  * use a StringReader
  */
 @Override
 public Reader getReader() throws IOException {
  String charset = getCharsetFromContentType( contentType );
  return charset == null 
   ? new StringReader( str )
   : new InputStreamReader( getStream(), charset );
 }
}
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.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.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);
  }
}
origin: com.hynnet/solr-solrj

 /**
  * If an charset is defined (by the contentType) use that, otherwise 
  * use a StringReader
  */
 @Override
 public Reader getReader() throws IOException {
  String charset = getCharsetFromContentType( contentType );
  return charset == null 
   ? new StringReader( str )
   : new InputStreamReader( getStream(), charset );
 }
}
org.apache.solr.common.utilContentStreamBase$StringStream

Javadoc

Construct a ContentStream from a String

Most used methods

  • <init>
  • getCharsetFromContentType
  • getStream
  • detect

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • CodeWhisperer 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