Removed unused code

This commit is contained in:
Oleg Kalnichevski 2017-12-21 14:47:10 +01:00
parent 8d08c38d4f
commit b2d063c6a8
3 changed files with 0 additions and 114 deletions

View File

@ -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
* <http://www.apache.org/>.
*
*/
package org.apache.hc.client5.http.impl.cache;
public class Counter {
private int count;
public void incr() {
count++;
}
public int getCount() {
return count;
}
}

View File

@ -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.
*/

View File

@ -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
* <http://www.apache.org/>.
*
*/
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<T> {
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;
}
}