Package org.apache.solr.client.solrj.request

# Class ContentStreamUpdateRequest

java.lang.Object
org.apache.solr.client.solrj.SolrRequest<UpdateResponse>
org.apache.solr.client.solrj.request.CollectionRequiringSolrRequest<UpdateResponse>
org.apache.solr.client.solrj.request.AbstractUpdateRequest
org.apache.solr.client.solrj.request.ContentStreamUpdateRequest

All Implemented Interfaces:
  `Serializable`

public class ContentStreamUpdateRequest extends AbstractUpdateRequest
Basic functionality to upload a File or `ContentStream` to a Solr Cell or some other handler that takes ContentStreams (CSV)

See https://solr.apache.org/guide/solr/latest/indexing-guide/indexing-with-tika.html
See https://solr.apache.org/guide/solr/latest/indexing-guide/indexing-with-update-handlers.html

See Also:
  - Serialized Form

## Nested Class Summary

## Nested classes/interfaces inherited from class org.apache.solr.client.solrj.request.AbstractUpdateRequest

`AbstractUpdateRequest.ACTION`

## Nested classes/interfaces inherited from class org.apache.solr.client.solrj.SolrRequest

`SolrRequest.ApiVersion, SolrRequest.METHOD, SolrRequest.SolrClientContext, SolrRequest.SolrRequestType`

## Field Summary

### Fields inherited from class org.apache.solr.client.solrj.request.AbstractUpdateRequest

`commitWithin, params`

### Fields inherited from class org.apache.solr.client.solrj.SolrRequest

`SUPPORTED_METHODS`

## Constructor Summary

Constructors
Constructor
Description
`ContentStreamUpdateRequest(String url)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addContentStream(ContentStream contentStream)`
Add a `ContentStream` to `getContentStreams()`
`void`
`addFile(Path file, String contentType)`
Add a File to the `ContentStream`s.
`Collection<ContentStream>`
`getContentStreams()`
`RequestWriter.ContentWriter`
`getContentWriter(String expectedType)`
If a request object wants to do a push write, implement this method.

### Methods inherited from class org.apache.solr.client.solrj.request.AbstractUpdateRequest

`createResponse, getAction, getCommitWithin, getParams, isWaitSearcher, rollback, setAction, setAction, setAction, setAction, setAction, setAction, setAction, setCommitWithin, setParam, setParams, setWaitSearcher`

### Methods inherited from class org.apache.solr.client.solrj.request.CollectionRequiringSolrRequest

`requiresCollection`

### Methods inherited from class org.apache.solr.client.solrj.SolrRequest

`addHeader, addHeaders, getApiVersion, getBasicAuthPassword, getBasicAuthUser, getCollection, getHeaders, getMethod, getPath, getPreferredNodes, getQueryParams, getRequestType, getResponseParser, getStreamingResponseCallback, getUserPrincipal, process, process, processWithBaseUrl, setBasicAuthCredentials, setMethod, setPath, setPreferredNodes, setQueryParams, setRequestType, setResponseParser, setStreamingResponseCallback, setUserPrincipal`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ContentStreamUpdateRequest

public ContentStreamUpdateRequest(String url)

Parameters:
  `url` - The URL to send the `ContentStream` to in Solr.

## Method Details

### getContentStreams

public Collection<ContentStream> getContentStreams() throws IOException

Overrides:
  `getContentStreams` in class `SolrRequest<UpdateResponse>`
Throws:
  `IOException`

### getContentWriter

public RequestWriter.ContentWriter getContentWriter(String expectedType)
Description copied from class: `SolrRequest`
If a request object wants to do a push write, implement this method.

Overrides:
  `getContentWriter` in class `SolrRequest<UpdateResponse>`
Parameters:
  `expectedType` - This is the type that the RequestWriter would like to get. But, it is OK to send any format

### addFile

public void addFile(Path file, String contentType) throws IOException
Add a File to the `ContentStream`s.

Parameters:
  `file` - The File to add.
Throws:
  `IOException` - if there was an error with the file.
See Also:
  - `getContentStreams()`
  - `ContentStreamBase.FileStream`

### addContentStream

public void addContentStream(ContentStream contentStream)
Add a `ContentStream` to `getContentStreams()`

Parameters:
  `contentStream` - The `ContentStream`