Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SolrRequest.getPath setPath documentation (#4665)

David Smiley6c793d553416
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
index 0f2b21b7f85..7574bd38967 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
@@ -172,11 +172,20 @@ public abstract class SolrRequest<T> implements Serializable {
this.method = method;
}
+ /**
+ * The URI path to a "request handler", such as "/select". Must start with a "/". For
+ * collection/core requests, this is appended to the core/collection path; otherwise it's a node
+ * level request and thus is relative to the solr root.
+ */
public String getPath() {
return path;
}
public void setPath(String path) {
+ if (path == null || !path.startsWith("/")) {
+ throw new IllegalArgumentException("Must start with a '/': " + path);
+ }
+
this.path = path;
}