MCPcopy Create free account
hub / github.com/EsperoTech/yaade / setProtocol

Method setProtocol

server/src/main/java/com/postman/collection/Url.java:288–301  ·  view source on GitHub ↗

Set the value of the protocol property with a string. This method will attempt to resolve the provided value to either 'http' or 'https', or null if a reasonable guess results in anything else. @param rawProtocol The protocol, eg http

(String rawProtocol)

Source from the content-addressed store, hash-verified

286 * @param rawProtocol The protocol, eg http
287 */
288 public void setProtocol(String rawProtocol) {
289
290
291 if (rawProtocol == null || rawProtocol.length() < 1) {
292 protocol = null;
293 } else if (rawProtocol.toLowerCase().contains("https")) {
294 protocol = "https";
295 } else if (rawProtocol.toLowerCase().contains("http")) {
296 protocol = "http";
297 } else {
298 protocol = null;
299 }
300
301 }
302
303
304 /**

Callers 1

setRawMethod · 0.95

Calls 2

lengthMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected