public class EepHead extends EepGet
EepHead foo = new EepHead(...); if (foo.fetch()) { String lastmod = foo.getLastModified(); if (lastmod != null) { parse the string... ... } }Other use cases (command line, listeners, etc...) lightly- or un-tested. Note that this follows redirects! This may not be what you want or expect. Writing from scratch rather than extending EepGet would maybe have been less bloated memory-wise. This way gets us redirect handling, among other benefits.
EepGet.AUTH_MODE, EepGet.AuthState, EepGet.CLIStatusListener, EepGet.Gunzipper, EepGet.StatusListener
修飾子とタイプ | フィールド | 説明 |
---|---|---|
(package private) static java.io.OutputStream |
_dummyStream |
EepGet needs either a non-null file or a stream...
|
_aborted, _actualURL, _alreadyTransferred, _authState, _bytesRemaining, _bytesTransferred, _contentType, _context, _currentAttempt, _decompressException, _encodingChunked, _etag, _etagOrig, _extraHeaders, _fetchHeaderTimeout, _fetchInactivityTimeout, _isGzippedResponse, _keepFetching, _lastModified, _lastModifiedOrig, _listeners, _log, _notModified, _numRetries, _out, _outputFile, _outputStream, _proxy, _proxyHost, _proxyIn, _proxyOut, _proxyPort, _redirectLocation, _redirects, _responseCode, _responseText, _shouldProxy, _shouldWriteErrorToOutput, _transferFailed, _url, CONNECT_TIMEOUT, INACTIVITY_TIMEOUT, MAX_COMPLETE_FAILS, USER_AGENT
コンストラクタ | 説明 |
---|---|
EepHead(I2PAppContext ctx,
java.lang.String proxyHost,
int proxyPort,
int numRetries,
java.lang.String url) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
protected void |
doFetch(SocketTimeout timeout) |
return true if the URL was completely retrieved
|
long |
getContentLength() |
We don't decrement the variable (unlike in EepGet), so this is valid
|
protected java.lang.String |
getRequest() |
|
static void |
main(java.lang.String[] args) |
EepHead [-p 127.0.0.1:4444] [-n #retries] url
This doesn't really do much since it doesn't register a listener.
|
addAuthorization, addHeader, addStatusListener, fetch, fetch, fetch, getContentType, getETag, getLastModified, getNotModified, getStatusCode, getStatusText, parseAuthArgs, readChunkLength, readHeaders, sendRequest, setWriteErrorToOutput, stopFetching, suggestName
static final java.io.OutputStream _dummyStream
public EepHead(I2PAppContext ctx, java.lang.String proxyHost, int proxyPort, int numRetries, java.lang.String url)
public static void main(java.lang.String[] args)
protected void doFetch(SocketTimeout timeout) throws java.io.IOException
protected java.lang.String getRequest() throws java.io.IOException
getRequest
クラス内 EepGet
java.io.IOException
public long getContentLength()