public class I2PSocketEepGet extends EepGet
EepGet.AUTH_MODE, EepGet.AuthState, EepGet.CLIStatusListener, EepGet.Gunzipper, EepGet.StatusListener_aborted, _acceptRanges, _actualURL, _alreadyTransferred, _authState, _bytesRemaining, _bytesTransferred, _cacheControl, _contentEncoding, _contentLanguage, _contentType, _context, _cookie, _csp, _currentAttempt, _decompressException, _encodingChunked, _etag, _etagOrig, _expiryDate, _extraHeaders, _fetchHeaderTimeout, _fetchInactivityTimeout, _fetchTotalTimeout, _isGzippedResponse, _keepFetching, _lastModified, _lastModifiedOrig, _listeners, _log, _maxCompleteFails, _notModified, _numRetries, _out, _outputFile, _outputStream, _proxy, _proxyHost, _proxyIn, _proxyOut, _proxyPort, _redirectLocation, _redirects, _referrerPolicy, _responseCode, _responseText, _server, _shouldProxy, _shouldWriteErrorToOutput, _status, _transferEncoding, _transferFailed, _url, _vary, _xContentTypeOptions, _xframeOptions, _xPoweredBy, _xssProtection, DEFAULT_CONNECT_TIMEOUT, DEFAULT_INACTIVITY_TIMEOUT, DEFAULT_MAX_COMPLETE_FAILS, DEFAULT_NUM_RETRIES, USER_AGENT| Constructor and Description |
|---|
I2PSocketEepGet(I2PAppContext ctx,
I2PSocketManager mgr,
int numRetries,
long minSize,
long maxSize,
String outputFile,
OutputStream outputStream,
String url)Creates an I2PSocketEepGet with full configuration. |
I2PSocketEepGet(I2PAppContext ctx,
I2PSocketManager mgr,
int numRetries,
String outputFile,
String url)Creates an I2PSocketEepGet with default size limits. |
| Modifier and Type | Method and Description |
|---|---|
boolean | fetch(long fetchHeaderTimeout,
long totalTimeout,
long inactivityTimeout)We have to override this to close _socket, since we can't use _proxy in super as the I2PSocket. |
protected String | getRequest()Guess we have to override this since
super doesn't strip the http://host from the GET line
which hoses some servers (opentracker)
HTTP proxy was kind enough to do this for us |
protected void | readHeaders()Overridden to disable inline gunzipping |
protected void | sendRequest(SocketTimeout timeout)Look up the address, get a socket from the I2PSocketManager supplied in the constructor,
and send the request. |
addAuthorization, addHeader, addStatusListener, doFetch, fetch, fetch, getAcceptRanges, getCacheControl, getContentEncoding, getContentLanguage, getContentType, getCookie, getCSP, getEtag, getExpiryDate, getLastModified, getNotModified, getReferrerPolicy, getServer, getStatus, getStatusCode, getStatusText, getTransferEncoding, getVary, getXContentTypeOptions, getXframeOptions, getXPoweredBy, getXSSProtection, main, parseAuthArgs, readChunkLength, setPostData, setPostData, setPostData, setWriteErrorToOutput, shouldReadBody, stopFetching, suggestNamepublic I2PSocketEepGet(I2PAppContext ctx, I2PSocketManager mgr, int numRetries, long minSize, long maxSize, String outputFile, OutputStream outputStream, String url)
ctx - the I2P app contextmgr - the socket managernumRetries - number of retries on failureminSize - minimum acceptable sizemaxSize - maximum acceptable sizeoutputFile - file to write output tooutputStream - stream to write output tourl - the URL to fetchpublic I2PSocketEepGet(I2PAppContext ctx, I2PSocketManager mgr, int numRetries, String outputFile, String url)
ctx - the I2P app contextmgr - the socket managernumRetries - number of retries on failureoutputFile - file to write output tourl - the URL to fetchpublic boolean fetch(long fetchHeaderTimeout,
long totalTimeout,
long inactivityTimeout)protected String getRequest() throws IOException
getRequest in class EepGetIOException - on bad URLprotected void readHeaders()
throws IOExceptionreadHeaders in class EepGetIOException - on IO errorprotected void sendRequest(SocketTimeout timeout) throws IOException
sendRequest in class EepGettimeout - connect and inactivity timeout, used to detect hung connectionsIOException - on IO error