ClientUtils (Solr 3.6.2 API)
Keywords: org.apache.solr.client.solrj.util.ClientUtils class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.client.solrj.util
Class ClientUtils

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

    public class ClientUtils

extends Object

TODO? should this go in common?

Since:
  solr 1.3
Version:
  $Id: ClientUtils.java 1075192 2011-02-28 00:50:09Z uschindler $

Field Summary
`static Collection<String>` | `fmts` Deprecated. Use `DateUtil.DEFAULT_DATE_FORMATS`
`static String` | `TEXT_XML`
`static TimeZone` | `UTC` Deprecated. Use `DateUtil.UTC`.

Constructor Summary
`ClientUtils()`

Method Summary
`static String` | `escapeQueryChars(String s)` See: Escaping Special Characters
`static DateFormat` | `getThreadLocalDateFormat()` Deprecated. use `DateUtil.getThreadLocalDateFormat()`
`static Date` | `parseDate(String d)` Deprecated. Use `DateUtil.parseDate(String)`
`static Collection<ContentStream>` | `toContentStreams(String str, String contentType)` Take a string and make it an iterable ContentStream
`static String` | `toQueryString(SolrParams params, boolean xml)`
`static SolrDocument` | `toSolrDocument(SolrInputDocument d)`
`static SolrInputDocument` | `toSolrInputDocument(SolrDocument d)`
`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

### fmts

    @Deprecated
    public static final Collection<String> fmts

  Deprecated. Use `DateUtil.DEFAULT_DATE_FORMATS`

### UTC

    @Deprecated
    public static TimeZone UTC

  Deprecated. Use `DateUtil.UTC`.

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

### toSolrInputDocument

    public static SolrInputDocument toSolrInputDocument(SolrDocument d)

  Parameters:
    `d` - SolrDocument to convert
  Returns:
    a SolrInputDocument with the same fields and values as the SolrDocument. All boosts are 1.0f

### toSolrDocument

    public static SolrDocument toSolrDocument(SolrInputDocument d)

  Parameters:
    `d` - SolrInputDocument to convert
  Returns:
    a SolrDocument with the same fields and values as the SolrInputDocument

### writeXML

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

  Throws:
    `IOException`

### toXML

    public static String toXML(SolrInputDocument doc)

### parseDate

    @Deprecated
    public static Date parseDate(String d)
                          throws ParseException,
                                 org.apache.commons.httpclient.util.DateParseException

  Deprecated. Use `DateUtil.parseDate(String)`

  Returns a formatter that can be use by the current thread if needed to convert Date objects to the Internal representation.

  Throws:
    `ParseException`
    `org.apache.commons.httpclient.util.DateParseException`

### getThreadLocalDateFormat

    @Deprecated
    public static DateFormat getThreadLocalDateFormat()

  Deprecated. use `DateUtil.getThreadLocalDateFormat()`

  Returns a formatter that can be use by the current thread if needed to convert Date objects to the Internal representation.

### escapeQueryChars

    public static String escapeQueryChars(String s)

  See: Escaping Special Characters

### toQueryString

    public static String toQueryString(SolrParams params,
                                       boolean xml)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD