Class HTTPRequest
java.lang.Object
org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char[]
private String
private String
private HTTPConnection
private SVNErrorMessage
private boolean
private boolean
private boolean
private boolean
private String
private byte[]
private InputStream
private DefaultHandler
private HTTPHeader
private OutputStream
private HTTPStatus
private long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringBuffer
composeHTTPHeader
(String request, String path, HTTPHeader header, long length, boolean keepAlive) private String
composeRequestURI
(String request, String path) private static long
computeTimeout
(HTTPStatus status, HTTPHeader header) static SVNErrorMessage
createDefaultErrorMessage
(SVNURL host, String path, HTTPStatus status, String context, Object[] contextObjects) void
dispatch
(String request, String path, HTTPHeader header, int ok1, int ok2, SVNErrorMessage context) heart of http engine.long
void
initCredentials
(HTTPAuthentication authentication, String method, String path) private SVNErrorMessage
readError
(String request, String path, SVNErrorMessage context) void
reset()
void
setAuthentication
(String auth) void
setConnection
(HTTPConnection connection) void
setCookies
(Map<String, List<String>> cookieHeader) void
setForceProxyAuth
(boolean force) void
setKeepAlive
(boolean isKeepAlive) void
setProxied
(boolean proxied) void
setProxyAuthentication
(String auth) void
setRequestBody
(byte[] body) void
void
void
setResponseHandler
(DefaultHandler handler) void
setResponseHeader
(HTTPHeader header) void
void
setSecured
(boolean secured) void
setStatus
(HTTPStatus status)
-
Field Details
-
CRLF
public static final char[] CRLF -
myIsSecured
private boolean myIsSecured -
myIsProxied
private boolean myIsProxied -
myConnection
-
myAuthentication
-
myProxyAuthentication
-
myResponseHeader
-
myStatus
-
myErrorMessage
-
myResponseHandler
-
myResponseStream
-
myRequestBody
private byte[] myRequestBody -
myRequestStream
-
myIsProxyAuthForced
private boolean myIsProxyAuthForced -
myIsKeepAlive
private boolean myIsKeepAlive -
myCharset
-
myTimeout
private long myTimeout -
myCookieHeaders
-
-
Constructor Details
-
HTTPRequest
-
-
Method Details
-
reset
public void reset() -
setProxied
public void setProxied(boolean proxied) -
setSecured
public void setSecured(boolean secured) -
setConnection
-
initCredentials
-
setAuthentication
-
setProxyAuthentication
-
setForceProxyAuth
public void setForceProxyAuth(boolean force) -
setResponseHandler
-
setResponseStream
-
setRequestBody
public void setRequestBody(byte[] body) -
setRequestBody
-
setRequestBody
-
dispatch
public void dispatch(String request, String path, HTTPHeader header, int ok1, int ok2, SVNErrorMessage context) throws IOException heart of http engine. features: // all this should be moved outside this method: - authentication callback to process 401 and 403 codes, failure results in returning error message. - another callback to process 301 and 302 codes, failure results in returning error message. - code that process ssl exceptions and re-prompts for client certificate when allowed. // auth error, ssl exception and "moved" errors should be processed by the caller. - code to send request body. - code to parse svn error response in case return code is not ok1 and ok2. - standard http error should be returned otherwise. - body may be resetable inputStream + length - IMeasurable. // this may throw IOException that will be converted to: timeout error, can't connect error, or ssl will re-prompt.- Throws:
IOException
-
computeTimeout
-
readError
-
getResponseHeader
-
getNextRequestTimeout
public long getNextRequestTimeout() -
getStatus
-
setStatus
-
setResponseHeader
-
getErrorMessage
-
composeHTTPHeader
private StringBuffer composeHTTPHeader(String request, String path, HTTPHeader header, long length, boolean keepAlive) -
composeRequestURI
-
createDefaultErrorMessage
public static SVNErrorMessage createDefaultErrorMessage(SVNURL host, String path, HTTPStatus status, String context, Object[] contextObjects) -
setKeepAlive
public void setKeepAlive(boolean isKeepAlive) -
setCookies
-