Define a REST endpoint mapped to HTTP PATCH with default path "/" as url

@param endpoint   The endpoint handler
@param mediaTypes (Optional) The accepted and returned types for this endpoint
163373
public static void patch(HttpConsumer<HttpExchange> endpoint, MediaTypes... mediaTypes) {
        addResource(Methods.PATCH, HandlerUtil.BASE_PATH, endpoint, mediaTypes);
    }
635663
public EndpointInfo build() {
        checkState(availableMimeTypes != null && !availableMimeTypes.isEmpty(),
                   "Should at least have an available media type.");
        return new EndpointInfo(hostnamePattern, pathMapping, regexPathPrefix,
                                fragment, defaultMimeType, availableMimeTypes);
    }
322794
public void changeEndpoint(String endpoint) throws ConnectionEndpointArray.UnknownSchemeException {
        changeEndpoints(new Endpoints(new ConnectionEndpointArray().addEndpoint(endpoint).toArray(new ConnectionEndpoint[1]), new TrustedKey[0]));
    }
1113567
function badRequestEndpoint(path, query, body) {
  return function () {
    body = body || getJSON(path);
    createEndpointFromObject(path, query, body).status(400);
    console.log('  registered error path %s', path);
  }
}
1351297
public void connect(URI endpoint) {
        if (endpoint.equals(this.getEndpoint()) && isListening) {
            return;
        }

        OkHttpClient client = new OkHttpClient.Builder()
                .readTimeout(0, TimeUnit.MILLISECONDS)
                .build();
        Request request = new Request.Builder()
                .url(endpoint.toString())
                .build();
        client.newWebSocket(request, this);
        client.dispatcher().executorService().shutdown();

        setEndpoint(endpoint);
    }
1159202
private URI addEndPoint(String endPoint) throws URISyntaxException {

        if (StringUtils.isEmpty(endPoint) || endPoint.equals("/")) {
            return this.baseUri;
        }

        if (this.baseUri.getPath().endsWith("/") || endPoint.startsWith("/")) {
            endPoint = this.baseUri.getPath() + endPoint;
        } else {
            endPoint = this.baseUri.getPath() + "/" + endPoint;
        }

        URI uri = null;

        URIBuilder builder = new URIBuilder();

        builder.setScheme(this.baseUri.getScheme());
        builder.setHost(this.baseUri.getHost());
        builder.setPort(this.baseUri.getPort());
        builder.setPath(endPoint);

        uri = builder.build();
        return uri;
    }
569176
public static MaterialAddResult materialAdd(String accessToken,
                                                MediaType type, File media) {
        HttpPost httpPost = new HttpPost(BASE_URI + "/shakearound/material/add");
        FileBody bin = new FileBody(media);
        MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder
                .create().addPart("media", bin);
        HttpEntity reqEntity = multipartEntityBuilder
                .addTextBody(PARAM_ACCESS_TOKEN, API.accessToken(accessToken))
                .addTextBody("type", type.name()).build();
        httpPost.setEntity(reqEntity);
        return LocalHttpClient.executeJsonResult(httpPost,
                MaterialAddResult.class);
    }
817814
function Endpoint(url) {
  if (!(this instanceof Endpoint)) return new Endpoint(url);

  var p;
  if (typeof url === 'string') {
    //parse url
    var rr = REGEXP_URL.exec(url);
    if (rr) {
      p = {
        protocol: rr[1],
        username: rr[2],
        password: rr[3],
        host: rr[4],
        port: rr[5],
        path: rr[6],
        url: rr[0]
      };
    }
  } else if (typeof url === 'object') {
    p = url;
  }
  p || (p = {});

  this.protocol = (p.protocol && p.protocol.toLowerCase()) || PROTOCOL.TCP;
  p.username && (this.username = p.username);
  p.password && (this.password = p.password);
  this.host = p.host || 'localhost';
  this.port = p.port || defaultPort(this.protocol);
  p.path && (this.path = p.path);
  p.url && (this.url = p.url);
}
816588
public void introspectPathParams() throws DeploymentException {

        //Section 4.3 JSR 356 - The allowed types for the @PathParam parameters are String, any Java primitive type, or boxed version thereof.
        Class<?>[] pathParamTypesAllowed = { String.class, char.class, Character.class, byte.class, Byte.class, short.class, Short.class, int.class, Integer.class, long.class,
                                            Long.class, float.class, Float.class, double.class, Double.class, boolean.class, Boolean.class };
        List<Class<?>> pathParamTypeList = Arrays.asList(pathParamTypesAllowed);
        Class<?>[] paramTypes = method.getParameterTypes();
        Annotation[][] paramAnnotations = method.getParameterAnnotations();
        boolean uriSegmentMatched = true;

        for (int i = 0; i < paramAnnotations.length; i++) {
            for (Annotation annotation : paramAnnotations[i]) {
                if (annotation.annotationType() == javax.websocket.server.PathParam.class) {
                    if (pathParamTypeList.contains(paramTypes[i])) {
                        String pathParamValue = ((PathParam) annotation).value();
                        if (pathParamValue != null && !(pathParamValue.isEmpty())) {
                            //check if user has defined @PathParam variable on a method,but there is no corresponding matching path segment in endpoint path
                            //for e.g user might have defined "@PathParam("Boolean-var") Boolean BooleanVar" on onOpen() and the server endpoint path
                            //is /somePath/{Integer-var}/{Long-var}
                            List<String> segments = Arrays.asList(endpointPath.split("/"));
                            if (!(segments.contains("{" + pathParamValue + "}")) && !(segments.contains(pathParamValue))) {
                                //error case: @PathParam does not match any path segment in the uri
                                if (tc.isDebugEnabled()) {
                                    String msg = "@PathParam parameter " + pathParamValue + " defined on the method " + method.getName()
                                                 + " does not have corresponding path segment in @ServerEndpoint URI in Annotated endpoint " + method.getDeclaringClass().getName();
                                    Tr.debug(tc, msg);
                                }
                                //set the parameter to null. This is needed for String type of param.
                                uriSegmentMatched = false;
                            }
                            //create PathParamData with annotation, the parameter index which has @PathParam declared, type of the parameter. 
                            PathParamData paramData = new PathParamDataImpl(pathParamValue, i, paramTypes[i], uriSegmentMatched);
                            //use key for the hashmap as parameter index which has @PathParam declared, so that we can retrieve the correct PathParamData
                            //during parameter value substitution
                            methodData.getPathParams().put(Integer.valueOf(i), paramData);
                        }
                        else {
                            //section 4.3 jsr 356. The value attribute of this annotation must be present otherwise the implementation must throw an  error. [WSC-4.3-2]
                            String msg = Tr.formatMessage(tc,
                                                          "missing.pathparam.value",
                                                          ((PathParam) annotation).value(), method.getName(), method.getDeclaringClass().getName());
                            Tr.error(tc,
                                     "missing.pathparam.value",
                                     ((PathParam) annotation).value(), method.getName(), method.getDeclaringClass().getName());
                            throw new DeploymentException(msg);
                        }
                    } else {
                        //section 4.3 jsr 356. "The allowed types for the @PathParam parameters are String, any Java primitive type, or boxed version thereof. Any other type 
                        //annotated with this annotation is an error that the implementation must report at deployment time. [WSC-4.3-1]"
                        String msg = Tr.formatMessage(tc,
                                                      "invalid.pathparam.type",
                                                      ((PathParam) annotation).value(), method.getName(), method.getDeclaringClass().getName());
                        Tr.error(tc,
                                 "invalid.pathparam.type",
                                 ((PathParam) annotation).value(), method.getName(), method.getDeclaringClass().getName());
                        throw new DeploymentException(msg);
                    }
                }
            }
        }
    }
289293
function MediaType (type, subtype, suffix) {
  this.type = type
  this.subtype = subtype
  this.suffix = suffix
}
16376
public static void options(HttpConsumer<HttpExchange> endpoint, MediaTypes... mediaTypes) {
        addResource(Methods.OPTIONS, HandlerUtil.BASE_PATH, endpoint, mediaTypes);
    }
1201544
@Override
    public Session connectToServer(Class<? extends Endpoint> endpointClass, ClientEndpointConfig endpointConfig, URI path) throws DeploymentException, IOException {

        Object theObject = null;

        if (endpointClass == null || path == null) {
            throw new IllegalArgumentException();
        }

        if (!(Endpoint.class.isAssignableFrom(endpointClass))) {
            DeploymentException e = new DeploymentException("Class " + endpointClass.getName() + " does not extend Endpoint");
            String msg = Tr.formatMessage(tc, "client.invalid.endpointclass", endpointClass.toString(), e.getMessage());
            Tr.error(tc, "client.invalid.endpointclass", endpointClass.toString(), e.getMessage());
            throw new DeploymentException(msg, e);
        }

        ClientConnector x = new ClientConnector();

        try {
            theObject = getEndpointInstance(endpointClass);
        } catch (DeploymentException e) {
            String msg = Tr.formatMessage(tc, "client.connection.error", endpointClass.toString(), e.getMessage());
            Tr.error(tc, "client.connection.error", endpointClass.toString(), e.getMessage());
            throw new DeploymentException(msg, e);
        }

        return x.connectClass(theObject, path, endpointConfig, this);
    }
277352
public static synchronized void multipart(String url, HttpConsumer<MultipartExchange> endpoint) {
        multipart(Methods.POST, url, endpoint, -1);
    }
89717
public EndpointInfoBuilder availableMimeTypes(Iterable<MediaType> availableMimeTypes) {
        requireNonNull(availableMimeTypes, "availableMimeTypes");
        checkArgument(!Iterables.isEmpty(availableMimeTypes), "Should at least have an available media type.");
        if (defaultMimeType != null && !Iterables.contains(availableMimeTypes, defaultMimeType)) {
            this.availableMimeTypes = addDefaultMimeType(defaultMimeType, availableMimeTypes);
        } else {
            this.availableMimeTypes = ImmutableSet.copyOf(availableMimeTypes);
        }
        return this;
    }
1297899
def _set_endpoint_configuration(self, rest_api, value):
        

        rest_api.EndpointConfiguration = {"Types": [value]}
        rest_api.Parameters = {"endpointConfigurationTypes": value}
45813
function Client(endpointUrl, sourceId) {
		this.restClient = new restClient.Client();

		this.endpointUrl = endpointUrl;

		if (this.endpointUrl) {
			// Remove the trailing slash if necessary
			if (this.endpointUrl.indexOf('/', this.endpointUrl.length - 1) !== -1) {
				this.endpointUrl = this.endpointUrl.substr(0, this.endpointUrl.length - 2);
			}

			// Add the default version if not present
			// TODO: The client should take care of the version in a better way
			if (this.endpointUrl.indexOf('/v1', this.endpointUrl.length - 3) === -1) {
				this.endpointUrl = this.endpointUrl + '/v1';
			}
		}

		if (sourceId !== undefined) {
			this.sourceId = sourceId;
		}
	}
1155851
private void resolveRequestEndpoint(Request<?> request, String bucketName, String key, URI endpoint) {
        ServiceEndpointBuilder builder = getBuilder(endpoint, endpoint.getScheme(), false);
        buildEndpointResolver(builder, bucketName, key).resolveRequestEndpoint(request);
    }