You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2017/09/02 15:28:07 UTC
[07/17] httpcomponents-client git commit: Moved classes and renamed
packages (no functional changes)
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ConnectionBackoffStrategy.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ConnectionBackoffStrategy.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ConnectionBackoffStrategy.java
deleted file mode 100644
index 9028334..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ConnectionBackoffStrategy.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-package org.apache.hc.client5.http.sync;
-
-import org.apache.hc.core5.http.HttpResponse;
-
-/**
- * When managing a dynamic number of connections for a given route, this
- * strategy assesses whether a given request execution outcome should
- * result in a backoff signal or not, based on either examining the
- * {@code Throwable} that resulted or by examining the resulting
- * response (e.g. for its status code).
- *
- * @since 4.2
- *
- */
-public interface ConnectionBackoffStrategy {
-
- /**
- * Determines whether seeing the given {@code Throwable} as
- * a result of request execution should result in a backoff
- * signal.
- * @param t the {@code Throwable} that happened
- * @return {@code true} if a backoff signal should be
- * given
- */
- boolean shouldBackoff(Throwable t);
-
- /**
- * Determines whether receiving the given {@link HttpResponse} as
- * a result of request execution should result in a backoff
- * signal. Implementations MUST restrict themselves to examining
- * the response header and MUST NOT consume any of the response
- * body, if any.
- * @param resp the {@code HttpResponse} that was received
- * @return {@code true} if a backoff signal should be
- * given
- */
- boolean shouldBackoff(HttpResponse resp);
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecChain.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecChain.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecChain.java
deleted file mode 100644
index f73f6c7..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecChain.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync;
-
-import java.io.IOException;
-
-import org.apache.hc.client5.http.HttpRoute;
-import org.apache.hc.client5.http.protocol.HttpClientContext;
-import org.apache.hc.core5.http.ClassicHttpRequest;
-import org.apache.hc.core5.http.ClassicHttpResponse;
-import org.apache.hc.core5.http.HttpException;
-import org.apache.hc.core5.util.Args;
-
-public interface ExecChain {
-
- final class Scope {
-
- public final HttpRoute route;
- public final ClassicHttpRequest originalRequest;
- public final ExecRuntime execRuntime;
- public final HttpClientContext clientContext;
-
- public Scope(final HttpRoute route, final ClassicHttpRequest originalRequest, final ExecRuntime execRuntime, final HttpClientContext clientContext) {
- this.route = Args.notNull(route, "Route");
- this.originalRequest = Args.notNull(originalRequest, "Original request");
- this.execRuntime = Args.notNull(execRuntime, "Exec runtime");
- this.clientContext = clientContext != null ? clientContext : HttpClientContext.create();
- }
-
- }
-
- ClassicHttpResponse proceed(
- ClassicHttpRequest request,
- Scope scope) throws IOException, HttpException;
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecChainHandler.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecChainHandler.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecChainHandler.java
deleted file mode 100644
index 3f55a92..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecChainHandler.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync;
-
-import java.io.IOException;
-
-import org.apache.hc.core5.http.ClassicHttpRequest;
-import org.apache.hc.core5.http.ClassicHttpResponse;
-import org.apache.hc.core5.http.HttpException;
-
-/**
- * This interface represents an element in the HTTP request execution chain. Each element can
- * either be a decorator around another element that implements a cross cutting aspect or
- * a self-contained executor capable of producing a response for the given request.
- * <p>
- * Important: please note it is required for decorators that implement post execution aspects
- * or response post-processing of any sort to release resources associated with the response
- * by calling {@link ClassicHttpResponse#close()} methods in case of an I/O, protocol or
- * runtime exception, or in case the response is not propagated to the caller.
- * </p>
- *
- * @since 4.3
- */
-public interface ExecChainHandler {
-
- ClassicHttpResponse execute(
- ClassicHttpRequest request,
- ExecChain.Scope scope,
- ExecChain chain) throws IOException, HttpException;
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecRuntime.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecRuntime.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecRuntime.java
deleted file mode 100644
index 17ff1de..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ExecRuntime.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync;
-
-import java.io.IOException;
-
-import org.apache.hc.client5.http.HttpRoute;
-import org.apache.hc.client5.http.protocol.HttpClientContext;
-import org.apache.hc.core5.annotation.Internal;
-import org.apache.hc.core5.http.ClassicHttpRequest;
-import org.apache.hc.core5.http.ClassicHttpResponse;
-import org.apache.hc.core5.http.HttpException;
-import org.apache.hc.core5.util.TimeValue;
-
-/**
- * Execution runtime that provides access to the underlying connection endpoint and helps
- * manager its life cycle.
- * <p>
- * This interface is considered internal and generally ought not be used or accessed
- * by custom request exec handlers.
- *
- * @since 5.0
- */
-@Internal
-public interface ExecRuntime {
-
- boolean isExecutionAborted();
-
- boolean isConnectionAcquired();
-
- void acquireConnection(
- HttpRoute route,
- Object state,
- HttpClientContext context) throws IOException;
-
- void releaseConnection();
-
- void discardConnection();
-
- boolean isConnected();
-
- void disconnect() throws IOException;
-
- void connect(HttpClientContext context) throws IOException;
-
- void upgradeTls(HttpClientContext context) throws IOException;
-
- ClassicHttpResponse execute(
- ClassicHttpRequest request,
- HttpClientContext context) throws IOException, HttpException;
-
- boolean isConnectionReusable();
-
- void markConnectionReusable();
-
- void markConnectionNonReusable();
-
- void setConnectionState(Object state);
-
- void setConnectionValidFor(TimeValue duration);
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpClient.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpClient.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpClient.java
deleted file mode 100644
index befa7ae..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpClient.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync;
-
-import java.io.IOException;
-
-import org.apache.hc.core5.http.ClassicHttpRequest;
-import org.apache.hc.core5.http.ClassicHttpResponse;
-import org.apache.hc.core5.http.HttpHost;
-import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.io.HttpClientResponseHandler;
-import org.apache.hc.core5.http.protocol.HttpContext;
-
-/**
- * This interface represents only the most basic contract for HTTP request
- * execution. It imposes no restrictions or particular details on the request
- * execution process and leaves the specifics of state management,
- * authentication and redirect handling up to individual implementations.
- *
- * @since 4.0
- */
-public interface HttpClient {
-
- /**
- * Executes HTTP request using the default context.
- *
- * @param request the request to execute
- *
- * @return the response to the request. This is always a final response,
- * never an intermediate response with an 1xx status code.
- * Whether redirects or authentication challenges will be returned
- * or handled automatically depends on the implementation and
- * configuration of this client.
- * @throws IOException in case of a problem or the connection was aborted
- */
- HttpResponse execute(ClassicHttpRequest request) throws IOException;
-
- /**
- * Executes HTTP request using the given context.
- *
- * @param request the request to execute
- * @param context the context to use for the execution, or
- * {@code null} to use the default context
- *
- * @return the response to the request. This is always a final response,
- * never an intermediate response with an 1xx status code.
- * Whether redirects or authentication challenges will be returned
- * or handled automatically depends on the implementation and
- * configuration of this client.
- * @throws IOException in case of a problem or the connection was aborted
- */
- HttpResponse execute(ClassicHttpRequest request, HttpContext context) throws IOException;
-
- /**
- * Executes HTTP request using the default context.
- *
- * @param target the target host for the request.
- * Implementations may accept {@code null}
- * if they can still determine a route, for example
- * to a default target or by inspecting the request.
- * @param request the request to execute
- *
- * @return the response to the request. This is always a final response,
- * never an intermediate response with an 1xx status code.
- * Whether redirects or authentication challenges will be returned
- * or handled automatically depends on the implementation and
- * configuration of this client.
- * @throws IOException in case of a problem or the connection was aborted
- */
- ClassicHttpResponse execute(HttpHost target, ClassicHttpRequest request) throws IOException;
-
- /**
- * Executes HTTP request using the given context.
- *
- * @param target the target host for the request.
- * Implementations may accept {@code null}
- * if they can still determine a route, for example
- * to a default target or by inspecting the request.
- * @param request the request to execute
- * @param context the context to use for the execution, or
- * {@code null} to use the default context
- *
- * @return the response to the request. This is always a final response,
- * never an intermediate response with an 1xx status code.
- * Whether redirects or authentication challenges will be returned
- * or handled automatically depends on the implementation and
- * configuration of this client.
- * @throws IOException in case of a problem or the connection was aborted
- */
- HttpResponse execute(HttpHost target, ClassicHttpRequest request, HttpContext context) throws IOException;
-
- /**
- * Executes HTTP request using the default context and processes the
- * response using the given response handler.
- * <p>
- * Implementing classes are required to ensure that the content entity
- * associated with the response is fully consumed and the underlying
- * connection is released back to the connection manager automatically
- * in all cases relieving individual {@link HttpClientResponseHandler}s from
- * having to manage resource deallocation internally.
- * </p>
- *
- * @param request the request to execute
- * @param HttpClientResponseHandler the response handler
- *
- * @return the response object as generated by the response handler.
- * @throws IOException in case of a problem or the connection was aborted
- */
- <T> T execute(ClassicHttpRequest request, HttpClientResponseHandler<? extends T> HttpClientResponseHandler) throws IOException;
-
- /**
- * Executes HTTP request using the given context and processes the
- * response using the given response handler.
- * <p>
- * Implementing classes are required to ensure that the content entity
- * associated with the response is fully consumed and the underlying
- * connection is released back to the connection manager automatically
- * in all cases relieving individual {@link HttpClientResponseHandler}s from
- * having to manage resource deallocation internally.
- * </p>
- *
- * @param request the request to execute
- * @param HttpClientResponseHandler the response handler
- * @param context the context to use for the execution, or
- * {@code null} to use the default context
- *
- * @return the response object as generated by the response handler.
- * @throws IOException in case of a problem or the connection was aborted
- */
- <T> T execute(ClassicHttpRequest request, HttpClientResponseHandler<? extends T> HttpClientResponseHandler, HttpContext context) throws IOException;
-
- /**
- * Executes HTTP request to the target using the default context and
- * processes the response using the given response handler.
- * <p>
- * Implementing classes are required to ensure that the content entity
- * associated with the response is fully consumed and the underlying
- * connection is released back to the connection manager automatically
- * in all cases relieving individual {@link HttpClientResponseHandler}s from
- * having to manage resource deallocation internally.
- * </p>
- *
- * @param target the target host for the request.
- * Implementations may accept {@code null}
- * if they can still determine a route, for example
- * to a default target or by inspecting the request.
- * @param request the request to execute
- * @param HttpClientResponseHandler the response handler
- *
- * @return the response object as generated by the response handler.
- * @throws IOException in case of a problem or the connection was aborted
- */
- <T> T execute(HttpHost target, ClassicHttpRequest request, HttpClientResponseHandler<? extends T> HttpClientResponseHandler) throws IOException;
-
- /**
- * Executes HTTP request to the target using the given context and
- * processes the response using the given response handler.
- * <p>
- * Implementing classes are required to ensure that the content entity
- * associated with the response is fully consumed and the underlying
- * connection is released back to the connection manager automatically
- * in all cases relieving individual {@link HttpClientResponseHandler}s from
- * having to manage resource deallocation internally.
- * </p>
- *
- * @param target the target host for the request.
- * Implementations may accept {@code null}
- * if they can still determine a route, for example
- * to a default target or by inspecting the request.
- * @param request the request to execute
- * @param HttpClientResponseHandler the response handler
- * @param context the context to use for the execution, or
- * {@code null} to use the default context
- *
- * @return the response object as generated by the response handler.
- * @throws IOException in case of a problem or the connection was aborted
- */
- <T> T execute(
- HttpHost target,
- ClassicHttpRequest request,
- HttpClientResponseHandler<? extends T> HttpClientResponseHandler,
- HttpContext context) throws IOException;
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpRequestRetryHandler.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpRequestRetryHandler.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpRequestRetryHandler.java
deleted file mode 100644
index fda0c72..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpRequestRetryHandler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync;
-
-import java.io.IOException;
-
-import org.apache.hc.core5.http.HttpRequest;
-import org.apache.hc.core5.http.protocol.HttpContext;
-
-/**
- * A handler for determining if an HttpRequest should be retried after a
- * recoverable exception during execution.
- * <p>
- * Implementations of this interface must be thread-safe. Access to shared
- * data must be synchronized as methods of this interface may be executed
- * from multiple threads.
- *
- * @since 4.0
- */
-public interface HttpRequestRetryHandler {
-
- /**
- * Determines if a method should be retried after an IOException
- * occurs during execution.
- *
- * @param request request failed die to an I/O exception.
- * @param exception the exception that occurred
- * @param executionCount the number of times this method has been
- * unsuccessfully executed
- * @param context the context for the request execution
- *
- * @return {@code true} if the method should be retried, {@code false}
- * otherwise
- */
- boolean retryRequest(HttpRequest request, IOException exception, int executionCount, HttpContext context);
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ServiceUnavailableRetryStrategy.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ServiceUnavailableRetryStrategy.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ServiceUnavailableRetryStrategy.java
deleted file mode 100644
index 6de9cef..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/ServiceUnavailableRetryStrategy.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync;
-
-import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.protocol.HttpContext;
-
-/**
- * Strategy interface that allows API users to plug in their own logic to
- * control whether or not a retry should automatically be done, how many times
- * it should be retried and so on.
- *
- * @since 4.2
- */
-public interface ServiceUnavailableRetryStrategy {
-
- /**
- * Determines if a method should be retried given the response from the target server.
- *
- * @param response the response from the target server
- * @param executionCount the number of times this method has been
- * unsuccessfully executed
- * @param context the context for the request execution
-
- * @return {@code true} if the method should be retried, {@code false}
- * otherwise
- */
- boolean retryRequest(HttpResponse response, int executionCount, HttpContext context);
-
- /**
- * @return The interval between the subsequent retry in milliseconds.
- */
- long getRetryInterval(HttpResponse response, HttpContext context);
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpDelete.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpDelete.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpDelete.java
deleted file mode 100644
index 0f28e0b..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpDelete.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import java.net.URI;
-
-/**
- * HTTP DELETE method
- * <p>
- * The HTTP DELETE method is defined in section 9.7 of
- * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC2616</a>:
- * <blockquote>
- * The DELETE method requests that the origin server delete the resource
- * identified by the Request-URI. [...] The client cannot
- * be guaranteed that the operation has been carried out, even if the
- * status code returned from the origin server indicates that the action
- * has been completed successfully.
- * </blockquote>
- *
- * @since 4.0
- */
-public class HttpDelete extends HttpUriRequestBase {
-
- private static final long serialVersionUID = 1L;
-
- public final static String METHOD_NAME = "DELETE";
-
-
- public HttpDelete(final URI uri) {
- super(METHOD_NAME, uri);
- }
-
- /**
- * @throws IllegalArgumentException if the uri is invalid.
- */
- public HttpDelete(final String uri) {
- this(URI.create(uri));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpExecutionAware.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpExecutionAware.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpExecutionAware.java
deleted file mode 100644
index 28b9336..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpExecutionAware.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import org.apache.hc.core5.concurrent.Cancellable;
-
-/**
- * Interface to be implemented by any object that wishes to be notified of
- * blocking I/O operations that could be cancelled.
- *
- * @since 4.3
- */
-public interface HttpExecutionAware {
-
- boolean isAborted();
-
- /**
- * Sets {@link Cancellable} for the ongoing operation.
- */
- void setCancellable(Cancellable cancellable);
-
-}
-
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpGet.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpGet.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpGet.java
deleted file mode 100644
index ed1c6c4..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpGet.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import java.net.URI;
-
-/**
- * HTTP GET method.
- * <p>
- * The HTTP GET method is defined in section 9.3 of
- * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC2616</a>:
- * </p>
- * <blockquote>
- * The GET method means retrieve whatever information (in the form of an
- * entity) is identified by the Request-URI. If the Request-URI refers
- * to a data-producing process, it is the produced data which shall be
- * returned as the entity in the response and not the source text of the
- * process, unless that text happens to be the output of the process.
- * </blockquote>
- *
- * @since 4.0
- */
-public class HttpGet extends HttpUriRequestBase {
-
- private static final long serialVersionUID = 1L;
-
- public final static String METHOD_NAME = "GET";
-
- public HttpGet(final URI uri) {
- super(METHOD_NAME, uri);
- }
-
- /**
- * @throws IllegalArgumentException if the uri is invalid.
- */
- public HttpGet(final String uri) {
- this(URI.create(uri));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpHead.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpHead.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpHead.java
deleted file mode 100644
index 028837b..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpHead.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import java.net.URI;
-
-/**
- * HTTP HEAD method.
- * <p>
- * The HTTP HEAD method is defined in section 9.4 of
- * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC2616</a>:
- * </p>
- * <blockquote>
- * The HEAD method is identical to GET except that the server MUST NOT
- * return a message-body in the response. The metainformation contained
- * in the HTTP headers in response to a HEAD request SHOULD be identical
- * to the information sent in response to a GET request. This method can
- * be used for obtaining metainformation about the entity implied by the
- * request without transferring the entity-body itself. This method is
- * often used for testing hypertext links for validity, accessibility,
- * and recent modification.
- * </blockquote>
- *
- * @since 4.0
- */
-public class HttpHead extends HttpUriRequestBase {
-
- private static final long serialVersionUID = 1L;
-
- public final static String METHOD_NAME = "HEAD";
-
- public HttpHead(final URI uri) {
- super(METHOD_NAME, uri);
- }
-
- /**
- * @throws IllegalArgumentException if the uri is invalid.
- */
- public HttpHead(final String uri) {
- this(URI.create(uri));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpOptions.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpOptions.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpOptions.java
deleted file mode 100644
index ea830e5..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpOptions.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import java.net.URI;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.hc.core5.http.HeaderElement;
-import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.message.MessageSupport;
-import org.apache.hc.core5.util.Args;
-
-/**
- * HTTP OPTIONS method.
- * <p>
- * The HTTP OPTIONS method is defined in section 9.2 of
- * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC2616</a>:
- * </p>
- * <blockquote>
- * The OPTIONS method represents a request for information about the
- * communication options available on the request/response chain
- * identified by the Request-URI. This method allows the client to
- * determine the options and/or requirements associated with a resource,
- * or the capabilities of a server, without implying a resource action
- * or initiating a resource retrieval.
- * </blockquote>
- *
- * @since 4.0
- */
-public class HttpOptions extends HttpUriRequestBase {
-
- private static final long serialVersionUID = 1L;
-
- public final static String METHOD_NAME = "OPTIONS";
-
- public HttpOptions(final URI uri) {
- super(METHOD_NAME, uri);
- }
-
- /**
- * @throws IllegalArgumentException if the uri is invalid.
- */
- public HttpOptions(final String uri) {
- this(URI.create(uri));
- }
-
- @Override
- public String getMethod() {
- return METHOD_NAME;
- }
-
- public Set<String> getAllowedMethods(final HttpResponse response) {
- Args.notNull(response, "HTTP response");
-
- final Iterator<HeaderElement> it = MessageSupport.iterate(response, "Allow");
- final Set<String> methods = new HashSet<>();
- while (it.hasNext()) {
- final HeaderElement element = it.next();
- methods.add(element.getName());
- }
- return methods;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPatch.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPatch.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPatch.java
deleted file mode 100644
index 00403ff..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPatch.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import java.net.URI;
-
-/**
- * HTTP PATCH method.
- * <p>
- * The HTTP PATCH method is defined in <a
- * href="http://tools.ietf.org/html/rfc5789">RF5789</a>:
- * </p>
- * <blockquote> The PATCH
- * method requests that a set of changes described in the request entity be
- * applied to the resource identified by the Request- URI. Differs from the PUT
- * method in the way the server processes the enclosed entity to modify the
- * resource identified by the Request-URI. In a PUT request, the enclosed entity
- * origin server, and the client is requesting that the stored version be
- * replaced. With PATCH, however, the enclosed entity contains a set of
- * instructions describing how a resource currently residing on the origin
- * server should be modified to produce a new version.
- * </blockquote>
- *
- * @since 4.2
- */
-public class HttpPatch extends HttpUriRequestBase {
-
- private static final long serialVersionUID = 1L;
-
- public final static String METHOD_NAME = "PATCH";
-
- public HttpPatch(final URI uri) {
- super(METHOD_NAME, uri);
- }
-
- public HttpPatch(final String uri) {
- this(URI.create(uri));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPost.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPost.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPost.java
deleted file mode 100644
index fcac1ff..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPost.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import java.net.URI;
-
-/**
- * HTTP POST method.
- * <p>
- * The HTTP POST method is defined in section 9.5 of
- * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC2616</a>:
- * </p>
- * <blockquote>
- * The POST method is used to request that the origin server accept the entity
- * enclosed in the request as a new subordinate of the resource identified by
- * the Request-URI in the Request-Line. POST is designed to allow a uniform
- * method to cover the following functions:
- * <ul>
- * <li>Annotation of existing resources</li>
- * <li>Posting a message to a bulletin board, newsgroup, mailing list, or
- * similar group of articles</li>
- * <li>Providing a block of data, such as the result of submitting a form,
- * to a data-handling process</li>
- * <li>Extending a database through an append operation</li>
- * </ul>
- * </blockquote>
- *
- * @since 4.0
- */
-public class HttpPost extends HttpUriRequestBase {
-
- private static final long serialVersionUID = 1L;
-
- public final static String METHOD_NAME = "POST";
-
- public HttpPost(final URI uri) {
- super(METHOD_NAME, uri);
- }
-
- /**
- * @throws IllegalArgumentException if the uri is invalid.
- */
- public HttpPost(final String uri) {
- this(URI.create(uri));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPut.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPut.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPut.java
deleted file mode 100644
index aa54877..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpPut.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import java.net.URI;
-
-/**
- * HTTP PUT method.
- * <p>
- * The HTTP PUT method is defined in section 9.6 of
- * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC2616</a>:
- * </p>
- * <blockquote>
- * The PUT method requests that the enclosed entity be stored under the
- * supplied Request-URI. If the Request-URI refers to an already
- * existing resource, the enclosed entity SHOULD be considered as a
- * modified version of the one residing on the origin server.
- * </blockquote>
- *
- * @since 4.0
- */
-public class HttpPut extends HttpUriRequestBase {
-
- private static final long serialVersionUID = 1L;
- public final static String METHOD_NAME = "PUT";
-
- public HttpPut(final URI uri) {
- super(METHOD_NAME, uri);
- }
-
- /**
- * @throws IllegalArgumentException if the uri is invalid.
- */
- public HttpPut(final String uri) {
- this(URI.create(uri));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpTrace.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpTrace.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpTrace.java
deleted file mode 100644
index 105c575..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpTrace.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import java.net.URI;
-
-/**
- * HTTP TRACE method.
- * <p>
- * The HTTP TRACE method is defined in section 9.6 of
- * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC2616</a>:
- * </p>
- * <blockquote>
- * The TRACE method is used to invoke a remote, application-layer loop-
- * back of the request message. The final recipient of the request
- * SHOULD reflect the message received back to the client as the
- * entity-body of a 200 (OK) response. The final recipient is either the
- * origin server or the first proxy or gateway to receive a Max-Forwards
- * value of zero (0) in the request (see section 14.31). A TRACE request
- * MUST NOT include an entity.
- * </blockquote>
- *
- * @since 4.0
- */
-public class HttpTrace extends HttpUriRequestBase {
-
- private static final long serialVersionUID = 1L;
-
- public final static String METHOD_NAME = "TRACE";
-
- public HttpTrace(final URI uri) {
- super(METHOD_NAME, uri);
- }
-
- /**
- * @throws IllegalArgumentException if the uri is invalid.
- */
- public HttpTrace(final String uri) {
- this(URI.create(uri));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpUriRequest.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpUriRequest.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpUriRequest.java
deleted file mode 100644
index 2a3cbf4..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpUriRequest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import org.apache.hc.core5.http.ClassicHttpRequest;
-
-/**
- * Extended version of the {@link ClassicHttpRequest} interface that provides
- * convenience methods to access request properties such as request URI
- * and method type.
- *
- * @since 4.0
- */
-public interface HttpUriRequest extends ClassicHttpRequest {
-
- /**
- * Aborts execution of the request.
- *
- * @throws UnsupportedOperationException if the abort operation
- * is not supported / cannot be implemented.
- */
- void abort() throws UnsupportedOperationException;
-
- /**
- * Tests if the request execution has been aborted.
- *
- * @return {@code true} if the request execution has been aborted,
- * {@code false} otherwise.
- */
- boolean isAborted();
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpUriRequestBase.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpUriRequestBase.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpUriRequestBase.java
deleted file mode 100644
index beb616c..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/HttpUriRequestBase.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-package org.apache.hc.client5.http.sync.methods;
-
-import java.net.URI;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.apache.hc.client5.http.CancellableAware;
-import org.apache.hc.client5.http.config.Configurable;
-import org.apache.hc.client5.http.config.RequestConfig;
-import org.apache.hc.core5.concurrent.Cancellable;
-import org.apache.hc.core5.http.message.BasicClassicHttpRequest;
-
-public class HttpUriRequestBase extends BasicClassicHttpRequest implements CancellableAware, Configurable {
-
- private static final long serialVersionUID = 1L;
-
- private RequestConfig requestConfig;
- private final AtomicBoolean aborted;
- private final AtomicReference<Cancellable> cancellableRef;
-
- public HttpUriRequestBase(final String method, final URI requestUri) {
- super(method, requestUri);
- this.aborted = new AtomicBoolean(false);
- this.cancellableRef = new AtomicReference<>(null);
- }
-
- public void abort() {
- if (this.aborted.compareAndSet(false, true)) {
- final Cancellable cancellable = this.cancellableRef.getAndSet(null);
- if (cancellable != null) {
- cancellable.cancel();
- }
- }
- }
-
- @Override
- public boolean isCancelled() {
- return isAborted();
- }
-
- public boolean isAborted() {
- return this.aborted.get();
- }
-
- /**
- * @since 4.2
- */
- @Override
- public void setCancellable(final Cancellable cancellable) {
- if (!this.aborted.get()) {
- this.cancellableRef.set(cancellable);
- }
- }
-
- /**
- * Resets internal state of the request making it reusable.
- *
- * @since 4.2
- */
- public void reset() {
- final Cancellable cancellable = this.cancellableRef.getAndSet(null);
- if (cancellable != null) {
- cancellable.cancel();
- }
- this.aborted.set(false);
- }
-
- public void setConfig(final RequestConfig requestConfig) {
- this.requestConfig = requestConfig;
- }
-
- @Override
- public RequestConfig getConfig() {
- return requestConfig;
- }
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append(getMethod()).append(" ").append(getRequestUri());
- return sb.toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/RequestBuilder.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/RequestBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/RequestBuilder.java
deleted file mode 100644
index c34973a..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/RequestBuilder.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.client5.http.sync.methods;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.hc.client5.http.StandardMethods;
-import org.apache.hc.client5.http.config.Configurable;
-import org.apache.hc.client5.http.config.RequestConfig;
-import org.apache.hc.client5.http.entity.UrlEncodedFormEntity;
-import org.apache.hc.core5.http.ClassicHttpRequest;
-import org.apache.hc.core5.http.ContentType;
-import org.apache.hc.core5.http.Header;
-import org.apache.hc.core5.http.HttpEntity;
-import org.apache.hc.core5.http.HttpVersion;
-import org.apache.hc.core5.http.NameValuePair;
-import org.apache.hc.core5.http.ProtocolVersion;
-import org.apache.hc.core5.http.io.entity.EntityUtils;
-import org.apache.hc.core5.http.message.BasicHeader;
-import org.apache.hc.core5.http.message.BasicNameValuePair;
-import org.apache.hc.core5.http.message.HeaderGroup;
-import org.apache.hc.core5.net.URIBuilder;
-import org.apache.hc.core5.util.Args;
-
-/**
- * Builder for {@link ClassicHttpRequest} instances.
- * <p>
- * Please note that this class treats parameters differently depending on composition
- * of the request: if the request has a content entity explicitly set with
- * {@link #setEntity(org.apache.hc.core5.http.HttpEntity)} or it is not an entity enclosing method
- * (such as POST or PUT), parameters will be added to the query component of the request URI.
- * Otherwise, parameters will be added as a URL encoded {@link UrlEncodedFormEntity entity}.
- * </p>
- *
- * @since 4.3
- */
-public class RequestBuilder {
-
- private String method;
- private Charset charset;
- private ProtocolVersion version;
- private URI uri;
- private HeaderGroup headergroup;
- private HttpEntity entity;
- private List<NameValuePair> parameters;
- private RequestConfig config;
-
- RequestBuilder(final String method) {
- super();
- this.charset = StandardCharsets.UTF_8;
- this.method = method;
- }
-
- RequestBuilder() {
- }
-
- RequestBuilder(final StandardMethods method) {
- this(method.name());
- }
-
- RequestBuilder(final String method, final URI uri) {
- super();
- this.method = method;
- this.uri = uri;
- }
-
- RequestBuilder(final StandardMethods method, final URI uri) {
- this(method.name(), uri);
- }
-
- RequestBuilder(final String method, final String uri) {
- super();
- this.method = method;
- this.uri = uri != null ? URI.create(uri) : null;
- }
-
- RequestBuilder(final StandardMethods method, final String uri) {
- this(method.name(), uri);
- }
-
- public static RequestBuilder create(final String method) {
- Args.notBlank(method, "HTTP method");
- return new RequestBuilder(method);
- }
-
- public static RequestBuilder get() {
- return new RequestBuilder(StandardMethods.GET.name());
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder get(final URI uri) {
- return new RequestBuilder(StandardMethods.GET, uri);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder get(final String uri) {
- return new RequestBuilder(StandardMethods.GET, uri);
- }
-
- public static RequestBuilder head() {
- return new RequestBuilder(StandardMethods.HEAD);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder head(final URI uri) {
- return new RequestBuilder(StandardMethods.HEAD, uri);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder head(final String uri) {
- return new RequestBuilder(StandardMethods.HEAD, uri);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder patch() {
- return new RequestBuilder(StandardMethods.PATCH.name());
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder patch(final URI uri) {
- return new RequestBuilder(StandardMethods.PATCH, uri);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder patch(final String uri) {
- return new RequestBuilder(StandardMethods.PATCH, uri);
- }
-
- public static RequestBuilder post() {
- return new RequestBuilder(StandardMethods.POST);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder post(final URI uri) {
- return new RequestBuilder(StandardMethods.POST, uri);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder post(final String uri) {
- return new RequestBuilder(StandardMethods.POST, uri);
- }
-
- public static RequestBuilder put() {
- return new RequestBuilder(StandardMethods.PUT);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder put(final URI uri) {
- return new RequestBuilder(StandardMethods.PUT, uri);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder put(final String uri) {
- return new RequestBuilder(StandardMethods.PUT, uri);
- }
-
- public static RequestBuilder delete() {
- return new RequestBuilder(StandardMethods.DELETE);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder delete(final URI uri) {
- return new RequestBuilder(StandardMethods.DELETE, uri);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder delete(final String uri) {
- return new RequestBuilder(StandardMethods.DELETE, uri);
- }
-
- public static RequestBuilder trace() {
- return new RequestBuilder(StandardMethods.TRACE);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder trace(final URI uri) {
- return new RequestBuilder(StandardMethods.TRACE, uri);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder trace(final String uri) {
- return new RequestBuilder(StandardMethods.TRACE, uri);
- }
-
- public static RequestBuilder options() {
- return new RequestBuilder(StandardMethods.OPTIONS);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder options(final URI uri) {
- return new RequestBuilder(StandardMethods.OPTIONS, uri);
- }
-
- /**
- * @since 4.4
- */
- public static RequestBuilder options(final String uri) {
- return new RequestBuilder(StandardMethods.OPTIONS, uri);
- }
-
- public static RequestBuilder copy(final ClassicHttpRequest request) {
- Args.notNull(request, "HTTP request");
- return new RequestBuilder().doCopy(request);
- }
-
- private RequestBuilder doCopy(final ClassicHttpRequest request) {
- if (request == null) {
- return this;
- }
- method = request.getMethod();
- version = request.getVersion();
-
- if (headergroup == null) {
- headergroup = new HeaderGroup();
- }
- headergroup.clear();
- headergroup.setHeaders(request.getAllHeaders());
-
- parameters = null;
- entity = null;
-
- final HttpEntity originalEntity = request.getEntity();
- final ContentType contentType = EntityUtils.getContentType(originalEntity);
- if (contentType != null &&
- contentType.getMimeType().equals(ContentType.APPLICATION_FORM_URLENCODED.getMimeType())) {
- try {
- final List<NameValuePair> formParams = EntityUtils.parse(originalEntity);
- if (!formParams.isEmpty()) {
- parameters = formParams;
- }
- } catch (final IOException ignore) {
- }
- } else {
- entity = originalEntity;
- }
-
- try {
- uri = request.getUri();
- } catch (final URISyntaxException ignore) {
- }
- if (request instanceof Configurable) {
- config = ((Configurable) request).getConfig();
- } else {
- config = null;
- }
- return this;
- }
-
- /**
- * @since 4.4
- */
- public RequestBuilder setCharset(final Charset charset) {
- this.charset = charset;
- return this;
- }
-
- /**
- * @since 4.4
- */
- public Charset getCharset() {
- return charset;
- }
-
- public String getMethod() {
- return method;
- }
-
- public ProtocolVersion getVersion() {
- return version;
- }
-
- public RequestBuilder setVersion(final ProtocolVersion version) {
- this.version = version;
- return this;
- }
-
- public URI getUri() {
- return uri;
- }
-
- public RequestBuilder setUri(final URI uri) {
- this.uri = uri;
- return this;
- }
-
- public RequestBuilder setUri(final String uri) {
- this.uri = uri != null ? URI.create(uri) : null;
- return this;
- }
-
- public Header getFirstHeader(final String name) {
- return headergroup != null ? headergroup.getFirstHeader(name) : null;
- }
-
- public Header getLastHeader(final String name) {
- return headergroup != null ? headergroup.getLastHeader(name) : null;
- }
-
- public Header[] getHeaders(final String name) {
- return headergroup != null ? headergroup.getHeaders(name) : null;
- }
-
- public RequestBuilder addHeader(final Header header) {
- if (headergroup == null) {
- headergroup = new HeaderGroup();
- }
- headergroup.addHeader(header);
- return this;
- }
-
- public RequestBuilder addHeader(final String name, final String value) {
- if (headergroup == null) {
- headergroup = new HeaderGroup();
- }
- this.headergroup.addHeader(new BasicHeader(name, value));
- return this;
- }
-
- public RequestBuilder removeHeader(final Header header) {
- if (headergroup == null) {
- headergroup = new HeaderGroup();
- }
- headergroup.removeHeader(header);
- return this;
- }
-
- public RequestBuilder removeHeaders(final String name) {
- if (name == null || headergroup == null) {
- return this;
- }
- for (final Iterator<Header> i = headergroup.headerIterator(); i.hasNext(); ) {
- final Header header = i.next();
- if (name.equalsIgnoreCase(header.getName())) {
- i.remove();
- }
- }
- return this;
- }
-
- public RequestBuilder setHeader(final Header header) {
- if (headergroup == null) {
- headergroup = new HeaderGroup();
- }
- this.headergroup.setHeader(header);
- return this;
- }
-
- public RequestBuilder setHeader(final String name, final String value) {
- if (headergroup == null) {
- headergroup = new HeaderGroup();
- }
- this.headergroup.setHeader(new BasicHeader(name, value));
- return this;
- }
-
- public HttpEntity getEntity() {
- return entity;
- }
-
- public RequestBuilder setEntity(final HttpEntity entity) {
- this.entity = entity;
- return this;
- }
-
- public List<NameValuePair> getParameters() {
- return parameters != null ? new ArrayList<>(parameters) :
- new ArrayList<NameValuePair>();
- }
-
- public RequestBuilder addParameter(final NameValuePair nvp) {
- Args.notNull(nvp, "Name value pair");
- if (parameters == null) {
- parameters = new LinkedList<>();
- }
- parameters.add(nvp);
- return this;
- }
-
- public RequestBuilder addParameter(final String name, final String value) {
- return addParameter(new BasicNameValuePair(name, value));
- }
-
- public RequestBuilder addParameters(final NameValuePair... nvps) {
- for (final NameValuePair nvp: nvps) {
- addParameter(nvp);
- }
- return this;
- }
-
- public RequestConfig getConfig() {
- return config;
- }
-
- public RequestBuilder setConfig(final RequestConfig config) {
- this.config = config;
- return this;
- }
-
- public ClassicHttpRequest build() {
- URI uriNotNull = this.uri != null ? this.uri : URI.create("/");
- HttpEntity entityCopy = this.entity;
- if (parameters != null && !parameters.isEmpty()) {
- if (entityCopy == null && (StandardMethods.POST.name().equalsIgnoreCase(method)
- || StandardMethods.PUT.name().equalsIgnoreCase(method))) {
- entityCopy = new UrlEncodedFormEntity(parameters, charset != null ? charset : StandardCharsets.ISO_8859_1);
- } else {
- try {
- uriNotNull = new URIBuilder(uriNotNull)
- .setCharset(this.charset)
- .addParameters(parameters)
- .build();
- } catch (final URISyntaxException ex) {
- // should never happen
- }
- }
- }
- final HttpUriRequestBase result = new HttpUriRequestBase(method, uriNotNull);
- result.setVersion(this.version != null ? this.version : HttpVersion.HTTP_1_1);
- if (this.headergroup != null) {
- result.setHeaders(this.headergroup.getAllHeaders());
- }
- result.setEntity(entityCopy);
- result.setConfig(this.config);
- return result;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/package-info.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/package-info.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/package-info.java
deleted file mode 100644
index d6e1e84..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/methods/package-info.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-/**
- * Standard HTTP method implementations.
- */
-package org.apache.hc.client5.http.sync.methods;
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/main/java/org/apache/hc/client5/http/sync/package-info.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/package-info.java b/httpclient5/src/main/java/org/apache/hc/client5/http/sync/package-info.java
deleted file mode 100644
index a42c4e3..0000000
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/sync/package-info.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-/**
- * Client HTTP communication APIs.
- */
-package org.apache.hc.client5.http.sync;
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpOptions.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpOptions.java b/httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpOptions.java
new file mode 100644
index 0000000..373ce5f
--- /dev/null
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpOptions.java
@@ -0,0 +1,51 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.hc.client5.http.classic.methods;
+
+import java.util.Set;
+
+import org.apache.hc.core5.http.message.BasicHttpResponse;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestHttpOptions {
+
+ @Test
+ public void testMultipleAllows() {
+ final BasicHttpResponse resp = new BasicHttpResponse(200, "test reason");
+ resp.addHeader("Allow", "POST");
+ resp.addHeader("Allow", "GET");
+
+ final HttpOptions opt = new HttpOptions("*");
+ final Set<String> methodsName = opt.getAllowedMethods(resp);
+
+ Assert.assertTrue(methodsName.contains("POST"));
+ Assert.assertTrue(methodsName.contains("GET"));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/6d17126c/httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpRequestBase.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpRequestBase.java b/httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpRequestBase.java
new file mode 100644
index 0000000..d68cdd5
--- /dev/null
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/classic/methods/TestHttpRequestBase.java
@@ -0,0 +1,50 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.hc.client5.http.classic.methods;
+
+import java.net.URI;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestHttpRequestBase {
+
+ @Test
+ public void testBasicProperties() throws Exception {
+ final HttpGet httpget = new HttpGet("http://host/path");
+ Assert.assertEquals("GET", httpget.getMethod());
+ Assert.assertEquals(new URI("http://host/path"), httpget.getUri());
+ }
+
+ @Test
+ public void testEmptyURI() throws Exception {
+ final HttpGet httpget = new HttpGet("");
+ Assert.assertEquals(new URI("/"), httpget.getUri());
+ }
+
+}