| java.lang.Object de.anomic.http.httpc
httpc | final public class httpc (Code) | | This class implements an http client. While http access is built-in in java
libraries, it is still necessary to implement the network interface since
otherwise there is no access to the HTTP/1.0 / HTTP/1.1 header information
that comes along each connection.
|
Inner Class :public static class connectionTimeComparator implements Comparator<httpc> | |
Inner Class :final public class response | |
Constructor Summary | |
public | httpc(String server, String vhost, int port, int timeout, boolean ssl, httpRemoteProxyConfig theRemoteProxyConfig, String incomingByteCountAccounting, String outgoingByteCountAccounting) Initialize the httpc-instance with the given data. |
Method Summary | |
public response | CONNECT(String remotehost, int remoteport, httpHeader requestHeader) Call the server with the CONNECT-method.
This is used to establish https-connections through a https-proxy
Parameters: host - To which host should a connection be made? Parameters: port - Which port should be connected? Parameters: requestHeader - prefilled httpHeader. | public response | GET(String path, httpHeader requestHeader) This method GETs a page from the server.
Parameters: path - The path to the page which should be GET. Parameters: requestHeader - Prefilled httpHeader. | public response | HEAD(String path, httpHeader requestHeader) This method gets only the header of a page.
Parameters: path - The path to the page whose header should be get. Parameters: requestHeader - Prefilled httpHeader. | public response | POST(String path, httpHeader requestHeader, InputStream ins) This method POSTs some data to a page.
Parameters: path - The path to the page which the post is sent to. Parameters: requestHeader - Prefilled httpHeader. Parameters: ins - InputStream with the data to be posted to the server. | public response | POST(String path, httpHeader requestHeader, serverObjects args, HashMap<String, byte[]> files) This method sends several files at once via a POST request. | public static httpc[] | allConnections() | public static int | checkIdleConnections() | public void | close() | public static int | closeAllConnections() | public static String | dateString(Date date) Returns the given date in an HTTP-usable format.
(according to RFC822)
Parameters: date - The Date-Object to be converted. | public void | finalize() | public long | getInputStreamByteCount() | public long | getOutputStreamByteCount() | public int | hashCode() | public boolean | isClosed() Check wether the connection of this instance is closed. | public static Map<String, String> | loadHashMap(yacyURL url, httpRemoteProxyConfig proxy) | public static void | main(String[] args) | public static Date | nowDate() Returns the current date as Date-Object. | public void | setAllowContentEncoding(boolean status) | public static byte[] | singleGET(String realhost, String virtualhost, int port, String path, int timeout, String user, String password, boolean ssl, httpRemoteProxyConfig theRemoteProxyConfig, httpHeader requestHeader, File download) | public static byte[] | singleGET(yacyURL u, String vhost, int timeout, String user, String password, httpRemoteProxyConfig theRemoteProxyConfig, File download) | public static byte[] | singlePOST(String realhost, String virtualhost, int port, String path, int timeout, String user, String password, boolean ssl, httpRemoteProxyConfig theRemoteProxyConfig, httpHeader requestHeader, serverObjects props, HashMap<String, byte[]> files) | public static byte[] | singlePOST(yacyURL u, String vhost, int timeout, String user, String password, httpRemoteProxyConfig theRemoteProxyConfig, serverObjects props, HashMap<String, byte[]> files) | public String | toString() Convert the status of this class into an String object to output it. | public static byte[] | wget(yacyURL url, String vhost, int timeout, String user, String password, httpRemoteProxyConfig theRemoteProxyConfig, httpHeader requestHeader, File download) | public static httpHeader | whead(yacyURL url, String vhost, int timeout, String user, String password, httpRemoteProxyConfig theRemoteProxyConfig) | public static httpHeader | whead(yacyURL url, String vhost, int timeout, String user, String password, httpRemoteProxyConfig theRemoteProxyConfig, httpHeader requestHeader) | public static byte[] | wput(yacyURL url, String vhost, int timeout, String user, String password, httpRemoteProxyConfig theRemoteProxyConfig, serverObjects props, HashMap<String, byte[]> files) |
adressed_port | public int adressed_port(Code) | | |
connectionTimeComparatorInstance | final public static connectionTimeComparator connectionTimeComparatorInstance(Code) | | |
initTimelastIO | public long initTimelastIO(Code) | | |
timeout | public int timeout(Code) | | |
yacyDebugMode | public static boolean yacyDebugMode(Code) | | |
CONNECT | public response CONNECT(String remotehost, int remoteport, httpHeader requestHeader) throws IOException(Code) | | Call the server with the CONNECT-method.
This is used to establish https-connections through a https-proxy
Parameters: host - To which host should a connection be made? Parameters: port - Which port should be connected? Parameters: requestHeader - prefilled httpHeader. Instance of response with the content. |
GET | public response GET(String path, httpHeader requestHeader) throws IOException(Code) | | This method GETs a page from the server.
Parameters: path - The path to the page which should be GET. Parameters: requestHeader - Prefilled httpHeader. Instance of response with the content. throws: IOException - |
HEAD | public response HEAD(String path, httpHeader requestHeader) throws IOException(Code) | | This method gets only the header of a page.
Parameters: path - The path to the page whose header should be get. Parameters: requestHeader - Prefilled httpHeader. Instance of response with the content. throws: IOException - |
POST | public response POST(String path, httpHeader requestHeader, InputStream ins) throws IOException(Code) | | This method POSTs some data to a page.
Parameters: path - The path to the page which the post is sent to. Parameters: requestHeader - Prefilled httpHeader. Parameters: ins - InputStream with the data to be posted to the server. Instance of response with the content. throws: IOException - |
POST | public response POST(String path, httpHeader requestHeader, serverObjects args, HashMap<String, byte[]> files) throws IOException(Code) | | This method sends several files at once via a POST request. Only those
files in the Hashtable files are written whose names are contained in
args.
Parameters: path - The path to the page which the post is sent to. Parameters: requestHeader - Prefilled httpHeader. Parameters: args - serverObjects with the names of the files to send. Parameters: files - HashMap with the names of the files as key and the contentof the files as value. Instance of response with the content. throws: IOException - |
allConnections | public static httpc[] allConnections()(Code) | | |
checkIdleConnections | public static int checkIdleConnections()(Code) | | |
close | public void close()(Code) | | |
closeAllConnections | public static int closeAllConnections()(Code) | | |
dateString | public static String dateString(Date date)(Code) | | Returns the given date in an HTTP-usable format.
(according to RFC822)
Parameters: date - The Date-Object to be converted. String with the date. |
finalize | public void finalize()(Code) | | |
getInputStreamByteCount | public long getInputStreamByteCount()(Code) | | |
getOutputStreamByteCount | public long getOutputStreamByteCount()(Code) | | |
hashCode | public int hashCode()(Code) | | |
isClosed | public boolean isClosed()(Code) | | Check wether the connection of this instance is closed.
true if the connection is no longer open. |
nowDate | public static Date nowDate()(Code) | | Returns the current date as Date-Object.
Date-object with the current time. |
setAllowContentEncoding | public void setAllowContentEncoding(boolean status)(Code) | | Sets wether the content is allowed to be unzipped while getting?
FIXME: The name of this method seems misleading, if I read the usage of
this method correctly?
Parameters: status - true, if the content is allowed to be decoded on the fly? |
singleGET | public static byte[] singleGET(String realhost, String virtualhost, int port, String path, int timeout, String user, String password, boolean ssl, httpRemoteProxyConfig theRemoteProxyConfig, httpHeader requestHeader, File download) throws IOException(Code) | | |
singlePOST | public static byte[] singlePOST(String realhost, String virtualhost, int port, String path, int timeout, String user, String password, boolean ssl, httpRemoteProxyConfig theRemoteProxyConfig, httpHeader requestHeader, serverObjects props, HashMap<String, byte[]> files) throws IOException(Code) | | |
toString | public String toString()(Code) | | Convert the status of this class into an String object to output it.
|
|
|