MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / explodePath

Method explodePath

src/tsd/AbstractHttpQuery.java:295–307  ·  view source on GitHub ↗

Returns the path component of the URI as an array of strings, split on the forward slash Similar to the #getQueryPath call, this returns only the path without the protocol, host, port or query string params. E.g. "/path/starts/here" will return an array of {"path", "starts", "here"} Note

()

Source from the content-addressed store, hash-verified

293 * @throws NullPointerException if the URI is null
294 */
295 public String[] explodePath() {
296 final String path = getQueryPath();
297 if (path.isEmpty()) {
298 throw new BadRequestException("Query path is empty");
299 }
300 if (path.charAt(0) != '/') {
301 throw new BadRequestException("Query path doesn't start with a slash");
302 }
303 // split may be a tad slower than other methods, but since the URIs are
304 // usually pretty short and not every request will make this call, we
305 // probably don't need any premature optimization
306 return path.substring(1).split("/");
307 }
308
309 /**
310 * Parses the query string to determine the base route for handing a query

Callers 3

explodeAPIPathMethod · 0.45
getQueryBaseRouteMethod · 0.45
getQueryBaseRouteMethod · 0.45

Calls 3

getQueryPathMethod · 0.95
isEmptyMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected