hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1634009 [3/3] - in /httpcomponents/httpcore/trunk: httpcore-ab/src/main/java/org/apache/http/benchmark/ httpcore-nio/src/examples/org/apache/http/examples/nio/ httpcore-nio/src/main/java/org/apache/http/impl/nio/ httpcore-nio/src/main/java...
Date Fri, 24 Oct 2014 07:15:01 GMT
Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineFormatter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineFormatter.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineFormatter.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineFormatter.java
Fri Oct 24 07:14:58 2014
@@ -51,17 +51,6 @@ import org.apache.http.util.CharArrayBuf
 @Immutable
 public class BasicLineFormatter implements LineFormatter {
 
-    /**
-     * A default instance of this class, for use as default or fallback.
-     * Note that {@link BasicLineFormatter} is not a singleton, there can
-     * be many instances of the class itself and of derived classes.
-     * The instance here provides non-customized, default behavior.
-     *
-     * @deprecated (4.3) use {@link #INSTANCE}
-     */
-    @Deprecated
-    public final static BasicLineFormatter DEFAULT = new BasicLineFormatter();
-
     public final static BasicLineFormatter INSTANCE = new BasicLineFormatter();
 
     public BasicLineFormatter() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineParser.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineParser.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicLineParser.java
Fri Oct 24 07:14:58 2014
@@ -59,17 +59,6 @@ import org.apache.http.util.CharArrayBuf
 @Immutable
 public class BasicLineParser implements LineParser {
 
-    /**
-     * A default instance of this class, for use as default or fallback.
-     * Note that {@link BasicLineParser} is not a singleton, there can
-     * be many instances of the class itself and of derived classes.
-     * The instance here provides non-customized, default behavior.
-     *
-     * @deprecated (4.3) use {@link #INSTANCE}
-     */
-    @Deprecated
-    public final static BasicLineParser DEFAULT = new BasicLineParser();
-
     public final static BasicLineParser INSTANCE = new BasicLineParser();
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/PoolEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/PoolEntry.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/PoolEntry.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/pool/PoolEntry.java
Fri Oct 24 07:14:58 2014
@@ -127,14 +127,6 @@ public abstract class PoolEntry<T, C> {
         return this.validityDeadline;
     }
 
-    /**
-     * @deprecated use {@link #getValidityDeadline()}
-     */
-    @Deprecated
-    public long getValidUnit() {
-        return this.validityDeadline;
-    }
-
     public Object getState() {
         return this.state;
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HTTP.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HTTP.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HTTP.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HTTP.java
Fri Oct 24 07:14:58 2014
@@ -69,62 +69,6 @@ public final class HTTP {
     public static final Charset DEF_CONTENT_CHARSET = Consts.ISO_8859_1;
     public static final Charset DEF_PROTOCOL_CHARSET = Consts.ASCII;
 
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public static final String UTF_8 = "UTF-8";
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public static final String UTF_16 = "UTF-16";
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public static final String US_ASCII = "US-ASCII";
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public static final String ASCII = "ASCII";
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public static final String ISO_8859_1 = "ISO-8859-1";
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public static final String DEFAULT_CONTENT_CHARSET = ISO_8859_1;
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public static final String DEFAULT_PROTOCOL_CHARSET = US_ASCII;
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public final static String OCTET_STREAM_TYPE = "application/octet-stream";
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public final static String PLAIN_TEXT_TYPE = "text/plain";
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public final static String CHARSET_PARAM = "; charset=";
-    /**
-     * @deprecated (4.2)
-     */
-    @Deprecated
-    public final static String DEFAULT_CONTENT_TYPE = OCTET_STREAM_TYPE;
-
     public static boolean isWhitespace(final char ch) {
         return ch == SP || ch == HT || ch == CR || ch == LF;
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpService.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpService.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpService.java
Fri Oct 24 07:14:58 2014
@@ -46,7 +46,6 @@ import org.apache.http.annotation.Immuta
 import org.apache.http.entity.ByteArrayEntity;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
-import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 import org.apache.http.util.EncodingUtils;
 import org.apache.http.util.EntityUtils;
@@ -70,98 +69,14 @@ import org.apache.http.util.EntityUtils;
  *
  * @since 4.0
  */
-@SuppressWarnings("deprecation")
-@Immutable // provided injected dependencies are immutable and deprecated methods are not
used
+@Immutable
 public class HttpService {
 
-    /**
-     * TODO: make all variables final in the next major version
-     */
-    private volatile HttpParams params = null;
-    private volatile HttpProcessor processor = null;
-    private volatile HttpRequestHandlerMapper handlerMapper = null;
-    private volatile ConnectionReuseStrategy connStrategy = null;
-    private volatile HttpResponseFactory responseFactory = null;
-    private volatile HttpExpectationVerifier expectationVerifier = null;
-
-    /**
-     * Create a new HTTP service.
-     *
-     * @param processor            the processor to use on requests and responses
-     * @param connStrategy         the connection reuse strategy
-     * @param responseFactory      the response factory
-     * @param handlerResolver      the handler resolver. May be null.
-     * @param expectationVerifier  the expectation verifier. May be null.
-     * @param params               the HTTP parameters
-     *
-     * @since 4.1
-     * @deprecated (4.3) use {@link HttpService#HttpService(HttpProcessor, ConnectionReuseStrategy,
-     *   HttpResponseFactory, HttpRequestHandlerMapper, HttpExpectationVerifier)}
-     */
-    @Deprecated
-    public HttpService(
-            final HttpProcessor processor,
-            final ConnectionReuseStrategy connStrategy,
-            final HttpResponseFactory responseFactory,
-            final HttpRequestHandlerResolver handlerResolver,
-            final HttpExpectationVerifier expectationVerifier,
-            final HttpParams params) {
-        this(processor,
-             connStrategy,
-             responseFactory,
-             new HttpRequestHandlerResolverAdapter(handlerResolver),
-             expectationVerifier);
-        this.params = params;
-    }
-
-    /**
-     * Create a new HTTP service.
-     *
-     * @param processor            the processor to use on requests and responses
-     * @param connStrategy         the connection reuse strategy
-     * @param responseFactory      the response factory
-     * @param handlerResolver      the handler resolver. May be null.
-     * @param params               the HTTP parameters
-     *
-     * @since 4.1
-     * @deprecated (4.3) use {@link HttpService#HttpService(HttpProcessor, ConnectionReuseStrategy,
-     *   HttpResponseFactory, HttpRequestHandlerMapper)}
-     */
-    @Deprecated
-    public HttpService(
-            final HttpProcessor processor,
-            final ConnectionReuseStrategy connStrategy,
-            final HttpResponseFactory responseFactory,
-            final HttpRequestHandlerResolver handlerResolver,
-            final HttpParams params) {
-        this(processor,
-             connStrategy,
-             responseFactory,
-             new HttpRequestHandlerResolverAdapter(handlerResolver),
-             null);
-        this.params = params;
-    }
-
-    /**
-     * Create a new HTTP service.
-     *
-     * @param proc             the processor to use on requests and responses
-     * @param connStrategy     the connection reuse strategy
-     * @param responseFactory  the response factory
-     *
-     * @deprecated (4.1) use {@link HttpService#HttpService(HttpProcessor,
-     *  ConnectionReuseStrategy, HttpResponseFactory, HttpRequestHandlerResolver, HttpParams)}
-     */
-    @Deprecated
-    public HttpService(
-            final HttpProcessor proc,
-            final ConnectionReuseStrategy connStrategy,
-            final HttpResponseFactory responseFactory) {
-        super();
-        setHttpProcessor(proc);
-        setConnReuseStrategy(connStrategy);
-        setResponseFactory(responseFactory);
-    }
+    private final HttpProcessor processor;
+    private final HttpRequestHandlerMapper handlerMapper;
+    private final ConnectionReuseStrategy connStrategy;
+    private final HttpResponseFactory responseFactory;
+    private final HttpExpectationVerifier expectationVerifier;
 
     /**
      * Create a new HTTP service.
@@ -226,65 +141,6 @@ public class HttpService {
     }
 
     /**
-     * @deprecated (4.1) set {@link HttpProcessor} using constructor
-     */
-    @Deprecated
-    public void setHttpProcessor(final HttpProcessor processor) {
-        Args.notNull(processor, "HTTP processor");
-        this.processor = processor;
-    }
-
-    /**
-     * @deprecated (4.1) set {@link ConnectionReuseStrategy} using constructor
-     */
-    @Deprecated
-    public void setConnReuseStrategy(final ConnectionReuseStrategy connStrategy) {
-        Args.notNull(connStrategy, "Connection reuse strategy");
-        this.connStrategy = connStrategy;
-    }
-
-    /**
-     * @deprecated (4.1) set {@link HttpResponseFactory} using constructor
-     */
-    @Deprecated
-    public void setResponseFactory(final HttpResponseFactory responseFactory) {
-        Args.notNull(responseFactory, "Response factory");
-        this.responseFactory = responseFactory;
-    }
-
-    /**
-     * @deprecated (4.1) set {@link HttpResponseFactory} using constructor
-     */
-    @Deprecated
-    public void setParams(final HttpParams params) {
-        this.params = params;
-    }
-
-    /**
-     * @deprecated (4.1) set {@link HttpRequestHandlerResolver} using constructor
-     */
-    @Deprecated
-    public void setHandlerResolver(final HttpRequestHandlerResolver handlerResolver) {
-        this.handlerMapper = new HttpRequestHandlerResolverAdapter(handlerResolver);
-    }
-
-    /**
-     * @deprecated (4.1) set {@link HttpExpectationVerifier} using constructor
-     */
-    @Deprecated
-    public void setExpectationVerifier(final HttpExpectationVerifier expectationVerifier)
{
-        this.expectationVerifier = expectationVerifier;
-    }
-
-    /**
-     * @deprecated (4.3) no longer used.
-     */
-    @Deprecated
-    public HttpParams getParams() {
-        return this.params;
-    }
-
-    /**
      * Handles receives one HTTP request over the given connection within the
      * given execution context and sends a response back to the client.
      *
@@ -426,23 +282,4 @@ public class HttpService {
         }
     }
 
-    /**
-     * Adaptor class to transition from HttpRequestHandlerResolver to HttpRequestHandlerMapper.
-     */
-    @Deprecated
-    private static class HttpRequestHandlerResolverAdapter implements HttpRequestHandlerMapper
{
-
-        private final HttpRequestHandlerResolver resolver;
-
-        public HttpRequestHandlerResolverAdapter(final HttpRequestHandlerResolver resolver)
{
-            this.resolver = resolver;
-        }
-
-        @Override
-        public HttpRequestHandler lookup(final HttpRequest request) {
-            return resolver.lookup(request.getRequestLine().getUri());
-        }
-
-    }
-
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java
Fri Oct 24 07:14:58 2014
@@ -88,34 +88,6 @@ public final class ImmutableHttpProcesso
         }
     }
 
-    /**
-     * @deprecated (4.3) do not use.
-     */
-    @Deprecated
-    public ImmutableHttpProcessor(
-            final HttpRequestInterceptorList requestInterceptors,
-            final HttpResponseInterceptorList responseInterceptors) {
-        super();
-        if (requestInterceptors != null) {
-            final int count = requestInterceptors.getRequestInterceptorCount();
-            this.requestInterceptors = new HttpRequestInterceptor[count];
-            for (int i = 0; i < count; i++) {
-                this.requestInterceptors[i] = requestInterceptors.getRequestInterceptor(i);
-            }
-        } else {
-            this.requestInterceptors = new HttpRequestInterceptor[0];
-        }
-        if (responseInterceptors != null) {
-            final int count = responseInterceptors.getResponseInterceptorCount();
-            this.responseInterceptors = new HttpResponseInterceptor[count];
-            for (int i = 0; i < count; i++) {
-                this.responseInterceptors[i] = responseInterceptors.getResponseInterceptor(i);
-            }
-        } else {
-            this.responseInterceptors = new HttpResponseInterceptor[0];
-        }
-    }
-
     public ImmutableHttpProcessor(final HttpRequestInterceptor... requestInterceptors) {
         this(requestInterceptors, null);
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
Fri Oct 24 07:14:58 2014
@@ -37,7 +37,6 @@ import org.apache.http.HttpRequestInterc
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.annotation.Immutable;
-import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.util.Args;
 
 /**
@@ -48,25 +47,10 @@ import org.apache.http.util.Args;
  * @since 4.0
  */
 @Immutable
-@SuppressWarnings("deprecation")
 public class RequestExpectContinue implements HttpRequestInterceptor {
 
-    private final boolean activeByDefault;
-
-    /**
-     * @deprecated (4.3) use {@link org.apache.http.protocol.RequestExpectContinue#RequestExpectContinue(boolean)}
-     */
-    @Deprecated
     public RequestExpectContinue() {
-        this(false);
-    }
-
-    /**
-     * @since 4.3
-     */
-    public RequestExpectContinue(final boolean activeByDefault) {
         super();
-        this.activeByDefault = activeByDefault;
     }
 
     @Override
@@ -81,11 +65,7 @@ public class RequestExpectContinue imple
                 // Do not send the expect header if request body is known to be empty
                 if (entity != null
                         && entity.getContentLength() != 0 && !ver.lessEquals(HttpVersion.HTTP_1_0))
{
-                    final boolean active = request.getParams().getBooleanParameter(
-                            CoreProtocolPNames.USE_EXPECT_CONTINUE, this.activeByDefault);
-                    if (active) {
-                        request.addHeader(HTTP.EXPECT_DIRECTIVE, HTTP.EXPECT_CONTINUE);
-                    }
+                    request.addHeader(HTTP.EXPECT_DIRECTIVE, HTTP.EXPECT_CONTINUE);
                 }
             }
         }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
Fri Oct 24 07:14:58 2014
@@ -33,8 +33,6 @@ import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.annotation.Immutable;
-import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
 /**
@@ -43,7 +41,6 @@ import org.apache.http.util.Args;
  *
  * @since 4.0
  */
-@SuppressWarnings("deprecation")
 @Immutable
 public class RequestUserAgent implements HttpRequestInterceptor {
 
@@ -63,16 +60,8 @@ public class RequestUserAgent implements
         throws HttpException, IOException {
         Args.notNull(request, "HTTP request");
         if (!request.containsHeader(HTTP.USER_AGENT)) {
-            String s = null;
-            final HttpParams params = request.getParams();
-            if (params != null) {
-                s = (String) params.getParameter(CoreProtocolPNames.USER_AGENT);
-            }
-            if (s == null) {
-                s = this.userAgent;
-            }
-            if (s != null) {
-                request.addHeader(HTTP.USER_AGENT, s);
+            if (this.userAgent != null) {
+                request.addHeader(HTTP.USER_AGENT, this.userAgent);
             }
         }
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
Fri Oct 24 07:14:58 2014
@@ -84,34 +84,6 @@ public class UriPatternMatcher<T> {
     }
 
     /**
-     * @deprecated (4.1) do not use
-     */
-    @Deprecated
-    public synchronized void setHandlers(final Map<String, T> map) {
-        Args.notNull(map, "Map of handlers");
-        this.map.clear();
-        this.map.putAll(map);
-    }
-
-    /**
-     * @deprecated (4.1) do not use
-     */
-    @Deprecated
-    public synchronized void setObjects(final Map<String, T> map) {
-        Args.notNull(map, "Map of handlers");
-        this.map.clear();
-        this.map.putAll(map);
-    }
-
-    /**
-     * @deprecated (4.1) do not use
-     */
-    @Deprecated
-    public synchronized Map<String, T> getObjects() {
-        return this.map;
-    }
-
-    /**
      * Looks up an object matching the given request path.
      *
      * @param path the request path

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/EntityUtils.java
Fri Oct 24 07:14:58 2014
@@ -35,10 +35,8 @@ import java.io.UnsupportedEncodingExcept
 import java.nio.charset.Charset;
 import java.nio.charset.UnsupportedCharsetException;
 
-import org.apache.http.HeaderElement;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
-import org.apache.http.NameValuePair;
 import org.apache.http.ParseException;
 import org.apache.http.entity.ContentType;
 import org.apache.http.protocol.HTTP;
@@ -143,57 +141,6 @@ public final class EntityUtils {
     }
 
     /**
-     * Obtains character set of the entity, if known.
-     *
-     * @param entity must not be null
-     * @return the character set, or null if not found
-     * @throws ParseException if header elements cannot be parsed
-     * @throws IllegalArgumentException if entity is null
-     *
-     * @deprecated (4.1.3) use {@link ContentType#getOrDefault(HttpEntity)}
-     */
-    @Deprecated
-    public static String getContentCharSet(final HttpEntity entity) throws ParseException
{
-        Args.notNull(entity, "Entity");
-        String charset = null;
-        if (entity.getContentType() != null) {
-            final HeaderElement values[] = entity.getContentType().getElements();
-            if (values.length > 0) {
-                final NameValuePair param = values[0].getParameterByName("charset");
-                if (param != null) {
-                    charset = param.getValue();
-                }
-            }
-        }
-        return charset;
-    }
-
-    /**
-     * Obtains MIME type of the entity, if known.
-     *
-     * @param entity must not be null
-     * @return the character set, or null if not found
-     * @throws ParseException if header elements cannot be parsed
-     * @throws IllegalArgumentException if entity is null
-     *
-     * @since 4.1
-     *
-     * @deprecated (4.1.3) use {@link ContentType#getOrDefault(HttpEntity)}
-     */
-    @Deprecated
-    public static String getContentMimeType(final HttpEntity entity) throws ParseException
{
-        Args.notNull(entity, "Entity");
-        String mimeType = null;
-        if (entity.getContentType() != null) {
-            final HeaderElement values[] = entity.getContentType().getElements();
-            if (values.length > 0) {
-                mimeType = values[0].getName();
-            }
-        }
-        return mimeType;
-    }
-
-    /**
      * Get the entity content as a String, using the provided default character set
      * if none is found in the entity.
      * If defaultCharset is null, the default "ISO-8859-1" is used.

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/SessionInputBufferMock.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/SessionInputBufferMock.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/SessionInputBufferMock.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/SessionInputBufferMock.java
Fri Oct 24 07:14:58 2014
@@ -28,7 +28,6 @@
 package org.apache.http.impl;
 
 import java.io.ByteArrayInputStream;
-import java.io.IOException;
 import java.io.InputStream;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
@@ -117,9 +116,4 @@ public class SessionInputBufferMock exte
         this(s.getBytes(charset), MessageConstraints.DEFAULT, charset);
     }
 
-    @Override
-    public boolean isDataAvailable(final int timeout) throws IOException {
-        return true;
-    }
-
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/integration/TestSyncHttp.java
Fri Oct 24 07:14:58 2014
@@ -850,7 +850,7 @@ public class TestSyncHttp {
                             new RequestTargetHost(),
                             new RequestConnControl(),
                             new RequestUserAgent(),
-                            new RequestExpectContinue(true) }));
+                            new RequestExpectContinue() }));
 
             final HttpResponse response = this.client.execute(post, host, conn);
             Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
@@ -913,7 +913,7 @@ public class TestSyncHttp {
                             new RequestTargetHost(),
                             new RequestConnControl(),
                             new RequestUserAgent(),
-                            new RequestExpectContinue(true) }));
+                            new RequestExpectContinue() }));
 
             final HttpResponse response = this.client.execute(post, host, conn);
             Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusLine().getStatusCode());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestChainBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestChainBuilder.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestChainBuilder.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestChainBuilder.java
Fri Oct 24 07:14:58 2014
@@ -43,7 +43,7 @@ public class TestChainBuilder {
         final HttpRequestInterceptor i2 = new RequestTargetHost();
         final HttpRequestInterceptor i3 = new RequestConnControl();
         final HttpRequestInterceptor i4 = new RequestUserAgent();
-        final HttpRequestInterceptor i5 = new RequestExpectContinue(true);
+        final HttpRequestInterceptor i5 = new RequestExpectContinue();
         cb.addFirst(i1);
         cb.addAllFirst(i2, i3);
         cb.addFirst(null);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java
Fri Oct 24 07:14:58 2014
@@ -298,7 +298,7 @@ public class TestStandardInterceptors {
         final String s = "whatever";
         final StringEntity entity = new StringEntity(s, "US-ASCII");
         request.setEntity(entity);
-        final RequestExpectContinue interceptor = new RequestExpectContinue(true);
+        final RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
         final Header header = request.getFirstHeader(HTTP.EXPECT_DIRECTIVE);
         Assert.assertNotNull(header);
@@ -313,7 +313,7 @@ public class TestStandardInterceptors {
         final String s = "whatever";
         final StringEntity entity = new StringEntity(s, "US-ASCII");
         request.setEntity(entity);
-        final RequestExpectContinue interceptor = new RequestExpectContinue(true);
+        final RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
         final Header header = request.getFirstHeader(HTTP.EXPECT_DIRECTIVE);
         Assert.assertNull(header);
@@ -326,7 +326,7 @@ public class TestStandardInterceptors {
         final String s = "";
         final StringEntity entity = new StringEntity(s, "US-ASCII");
         request.setEntity(entity);
-        final RequestExpectContinue interceptor = new RequestExpectContinue(true);
+        final RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
         final Header header = request.getFirstHeader(HTTP.EXPECT_DIRECTIVE);
         Assert.assertNull(header);
@@ -334,7 +334,7 @@ public class TestStandardInterceptors {
 
     @Test
     public void testRequestExpectContinueInvalidInput() throws Exception {
-        final RequestExpectContinue interceptor = new RequestExpectContinue(true);
+        final RequestExpectContinue interceptor = new RequestExpectContinue();
         try {
             interceptor.process(null, null);
             Assert.fail("IllegalArgumentException should have been thrown");
@@ -347,7 +347,7 @@ public class TestStandardInterceptors {
     public void testRequestExpectContinueIgnoreNonenclosingRequests() throws Exception {
         final HttpContext context = new BasicHttpContext(null);
         final BasicHttpRequest request = new BasicHttpRequest("POST", "/");
-        final RequestExpectContinue interceptor = new RequestExpectContinue(true);
+        final RequestExpectContinue interceptor = new RequestExpectContinue();
         interceptor.process(request, context);
         Assert.assertEquals(0, request.getAllHeaders().length);
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java?rev=1634009&r1=1634008&r2=1634009&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/testserver/HttpClient.java
Fri Oct 24 07:14:58 2014
@@ -75,7 +75,7 @@ public class HttpClient {
                         new RequestTargetHost(),
                         new RequestConnControl(),
                         new RequestUserAgent("TEST-CLIENT/1.1"),
-                        new RequestExpectContinue(true)
+                        new RequestExpectContinue()
                 }));
     }
 



Mime
View raw message