Example usage for org.apache.solr.core RequestHandlers normalize

List of usage examples for org.apache.solr.core RequestHandlers normalize

Introduction

In this page you can find the example usage for org.apache.solr.core RequestHandlers normalize.

Prototype

public static String normalize(String p) 

Source Link

Document

Trim the trailing '/' if it's there, and convert null to empty string.

Usage

From source file:org.vootoo.server.RequestProcesser.java

License:Apache License

protected SolrQueryRequest parseSolrQueryRequest(SolrRequestParsers parser, RequestGetter requestGetter)
        throws Exception {
    ArrayList<ContentStream> streams = new ArrayList<>(1);
    if (requestGetter.getContentStreams() != null && requestGetter.getContentStreams().size() > 0) {
        streams.addAll(requestGetter.getContentStreams());
    }//from  w  w w . j a  v  a  2 s .  com
    SolrQueryRequest sreq = parser.buildRequestFrom(core, requestGetter.getSolrParams(), streams);

    // Handlers and login will want to know the path. If it contains a ':'
    // the handler could use it for RESTful URLs
    sreq.getContext().put("path", RequestHandlers.normalize(requestGetter.getPath()));

    return sreq;
}