From b2d063c6a8267b49d1664a5f4861c1614850024c Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Thu, 21 Dec 2017 14:47:10 +0100 Subject: [PATCH] Removed unused code --- .../hc/client5/http/impl/cache/Counter.java | 41 --------------- .../http/impl/cache/HttpTestUtils.java | 22 -------- .../client5/http/impl/cache/Serializer.java | 51 ------------------- 3 files changed, 114 deletions(-) delete mode 100644 httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/Counter.java delete mode 100644 httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/Serializer.java diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/Counter.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/Counter.java deleted file mode 100644 index 4f8a7f09c..000000000 --- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/Counter.java +++ /dev/null @@ -1,41 +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 - * . - * - */ -package org.apache.hc.client5.http.impl.cache; - -public class Counter { - - private int count; - - public void incr() { - count++; - } - - public int getCount() { - return count; - } - -} diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/HttpTestUtils.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/HttpTestUtils.java index a6fce24d1..1203f9916 100644 --- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/HttpTestUtils.java +++ b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/HttpTestUtils.java @@ -84,16 +84,6 @@ public class HttpTestUtils { "Max-Forwards", "Proxy-Authorization", "Range", "Referer", "Retry-After", "Server", "User-Agent", "Vary" }; - /* - * "Entity-header fields define metainformation about the entity-body or, - * if no body is present, about the resource identified by the request." - * - * http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7.1 - */ - public static final String[] ENTITY_HEADERS = { "Allow", "Content-Encoding", - "Content-Language", "Content-Length", "Content-Location", "Content-MD5", - "Content-Range", "Content-Type", "Expires", "Last-Modified" }; - /* * Determines whether the given header name is considered a hop-by-hop * header. @@ -109,18 +99,6 @@ public class HttpTestUtils { return false; } - /* - * Determines whether a given header name may appear multiple times. - */ - public static boolean isMultiHeader(final String name) { - for (final String s : MULTI_HEADERS) { - if (s.equalsIgnoreCase(name)) { - return true; - } - } - return false; - } - /* * Determines whether a given header name may only appear once in a message. */ diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/Serializer.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/Serializer.java deleted file mode 100644 index 9066a06b9..000000000 --- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/Serializer.java +++ /dev/null @@ -1,51 +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 - * . - * - */ -package org.apache.hc.client5.http.impl.cache; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; - -public class Serializer { - - public byte[] serialize(final T object) throws Exception { - final ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); - final ObjectOutputStream objectStream = new ObjectOutputStream(byteStream); - objectStream.writeObject(object); - return byteStream.toByteArray(); - } - - @SuppressWarnings("unchecked") - public T deserialize(final byte[] serialized) throws Exception { - final ByteArrayInputStream byteStream = new ByteArrayInputStream(serialized); - final ObjectInputStream objectStream = new ObjectInputStream(byteStream); - final T object = (T) objectStream.readObject(); - return object; - } - -}