org.apache.solr.client.solrj.util

## Class ClientUtils

- java.lang.Object
- - org.apache.solr.client.solrj.util.ClientUtils

    public class ClientUtils
    extends Object

Since:
  solr 1.3

### Field Summary

Fields
`static String` `TEXT_XML`

### Constructor Summary

Constructors
Constructor and Description
`ClientUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `addSlices(Map<String,Slice> target, String collectionName, Collection<Slice> slices, boolean multiCollection)` Constructs a slices map from a collection of slices and handles disambiguation if multiple collections are being queried simultaneously
`static String` `escapeQueryChars(String s)` See: Lucene query parser syntax for more information on Escaping Special Characters
`static Collection<ContentStream>` `toContentStreams(String str, String contentType)` Take a string and make it an iterable ContentStream
`static String` `toXML(SolrInputDocument doc)`
`static void` `writeXML(SolrInputDocument doc, Writer writer)`

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

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

### Field Detail

#### TEXT_XML

    public static final String TEXT_XML

See Also:
  Constant Field Values

### Constructor Detail

#### ClientUtils

    public ClientUtils()

### Method Detail

#### toContentStreams

    public static Collection<ContentStream> toContentStreams(String str,
                                                             String contentType)

Take a string and make it an iterable ContentStream

#### writeXML

    public static void writeXML(SolrInputDocument doc,
                                Writer writer)
                         throws IOException

Throws:
  `IOException`

#### toXML

    public static String toXML(SolrInputDocument doc)

#### escapeQueryChars

    public static String escapeQueryChars(String s)

See: Lucene query parser syntax for more information on Escaping Special Characters

#### addSlices

    public static void addSlices(Map<String,Slice> target,
                                 String collectionName,
                                 Collection<Slice> slices,
                                 boolean multiCollection)

Constructs a slices map from a collection of slices and handles disambiguation if multiple collections are being queried simultaneously