removed unused class and added license header for new class

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7680 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent f6077b3cc0
commit 528da7c9ea

@ -1,88 +0,0 @@
/**
* HttpConnector
* Copyright 2010 by Michael Peter Christen
* First released 25.05.2010 at http://yacy.net
*
* $LastChangedDate$
* $LastChangedRevision$
* $LastChangedBy$
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program in the file lgpl21.txt
* If not, see <http://www.gnu.org/licenses/>.
*/
package net.yacy.cora.protocol.http;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import net.yacy.cora.document.MultiProtocolURI;
import org.apache.http.entity.mime.content.ContentBody;
/**
* This Connector is a convenience class to access the protocol-specific http client class.
* @deprecated this class is not used anymore
*/
public class HTTPConnector {
private static final ConcurrentMap<String, HTTPConnector> cons = new ConcurrentHashMap<String, HTTPConnector>();
private String userAgent;
private HTTPConnector(String userAgent) {
this.userAgent = userAgent;
}
public static final HTTPConnector getConnector(String userAgent) {
HTTPConnector c = cons.get(userAgent);
if (c != null) return c;
c = new HTTPConnector(userAgent);
return c;
}
/**
* send data to the server named by vhost
*
* @param url address of the server
* @param timeout in milliseconds
* @param vhost name of the server at address which should respond
* @param post data to send (name-value-pairs)
* @return response body
* @throws IOException
*/
public byte[] post(final MultiProtocolURI url, final int timeout, final String vhost, final Map<String, ContentBody> post) throws IOException {
return post(url, timeout, vhost, post, false);
}
/**
* send data to the server named by vhost
*
* @param url address of the server
* @param timeout in milliseconds
* @param vhost name of the server at address which should respond
* @param post data to send (name-value-pairs)
* @param usegzip if the body should be gzipped
* @return response body
* @throws IOException
*/
public byte[] post(final MultiProtocolURI url, final int timeout, final String vhost, final Map<String, ContentBody> post, final boolean usegzip) throws IOException {
final HTTPClient client = new HTTPClient(this.userAgent);
client.setTimout(timeout);
return client.POSTbytes(url, vhost, post, usegzip);
}
}

@ -1,3 +1,27 @@
/**
* Evaluation
* Copyright 2011 by Michael Peter Christen
* First released 28.04.2011 at http://yacy.net
*
* $LastChangedDate: 2011-03-08 02:51:51 +0100 (Di, 08 Mrz 2011) $
* $LastChangedRevision: 7567 $
* $LastChangedBy: low012 $
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program in the file lgpl21.txt
* If not, see <http://www.gnu.org/licenses/>.
*/
package net.yacy.document.parser.html;
import java.io.File;

Loading…
Cancel
Save