@param uri HTTP request URI, with or without query parameters. @return true if the URI represents a request for a HttpRpcPlugin; false otherwise. Note that this method returning true says nothing about whether or not there is a HttpRpcPlugin register
(final String uri)
| 224 | * at the given URI, only that it's a valid RPC plugin request. |
| 225 | */ |
| 226 | boolean isHttpRpcPluginPath(final String uri) { |
| 227 | if (Strings.isNullOrEmpty(uri) || uri.length() <= PLUGIN_BASE_WEBPATH.length()) { |
| 228 | return false; |
| 229 | } else { |
| 230 | // Don't consider the query portion, if any. |
| 231 | int qmark = uri.indexOf('?'); |
| 232 | String path = uri; |
| 233 | if (qmark != -1) { |
| 234 | path = uri.substring(0, qmark); |
| 235 | } |
| 236 | |
| 237 | final List<String> parts = WEBPATH_SPLITTER.splitToList(path); |
| 238 | return (parts.size() > 1 && parts.get(0).equals(PLUGIN_BASE_WEBPATH)); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * Load and init instances of {@link TelnetRpc}s and {@link HttpRpc}s. |