Class HTTPRequest


  • class HTTPRequest
    extends java.lang.Object
    Version:
    1.3
    • Field Detail

      • CRLF

        public static final char[] CRLF
      • myIsSecured

        private boolean myIsSecured
      • myIsProxied

        private boolean myIsProxied
      • myAuthentication

        private java.lang.String myAuthentication
      • myProxyAuthentication

        private java.lang.String myProxyAuthentication
      • myResponseHeader

        private HTTPHeader myResponseHeader
      • myResponseHandler

        private org.xml.sax.helpers.DefaultHandler myResponseHandler
      • myResponseStream

        private java.io.OutputStream myResponseStream
      • myRequestBody

        private byte[] myRequestBody
      • myRequestStream

        private java.io.InputStream myRequestStream
      • myIsProxyAuthForced

        private boolean myIsProxyAuthForced
      • myIsKeepAlive

        private boolean myIsKeepAlive
      • myCharset

        private java.lang.String myCharset
      • myTimeout

        private long myTimeout
      • myCookieHeaders

        private java.util.Map<java.lang.String,​java.util.List<java.lang.String>> myCookieHeaders
    • Constructor Detail

      • HTTPRequest

        public HTTPRequest​(java.lang.String charset)
    • Method Detail

      • reset

        public void reset()
      • setProxied

        public void setProxied​(boolean proxied)
      • setSecured

        public void setSecured​(boolean secured)
      • setConnection

        public void setConnection​(HTTPConnection connection)
      • initCredentials

        public void initCredentials​(HTTPAuthentication authentication,
                                    java.lang.String method,
                                    java.lang.String path)
      • setAuthentication

        public void setAuthentication​(java.lang.String auth)
      • setProxyAuthentication

        public void setProxyAuthentication​(java.lang.String auth)
      • setForceProxyAuth

        public void setForceProxyAuth​(boolean force)
      • setResponseHandler

        public void setResponseHandler​(org.xml.sax.helpers.DefaultHandler handler)
      • setResponseStream

        public void setResponseStream​(java.io.OutputStream os)
      • setRequestBody

        public void setRequestBody​(byte[] body)
      • setRequestBody

        public void setRequestBody​(java.lang.StringBuffer sb)
      • setRequestBody

        public void setRequestBody​(java.io.InputStream is)
      • dispatch

        public void dispatch​(java.lang.String request,
                             java.lang.String path,
                             HTTPHeader header,
                             int ok1,
                             int ok2,
                             SVNErrorMessage context)
                      throws java.io.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:
        java.io.IOException
      • getResponseHeader

        public HTTPHeader getResponseHeader()
      • getNextRequestTimeout

        public long getNextRequestTimeout()
      • setStatus

        public void setStatus​(HTTPStatus status)
      • setResponseHeader

        public void setResponseHeader​(HTTPHeader header)
      • composeHTTPHeader

        private java.lang.StringBuffer composeHTTPHeader​(java.lang.String request,
                                                         java.lang.String path,
                                                         HTTPHeader header,
                                                         long length,
                                                         boolean keepAlive)
      • composeRequestURI

        private java.lang.String composeRequestURI​(java.lang.String request,
                                                   java.lang.String path)
      • createDefaultErrorMessage

        public static SVNErrorMessage createDefaultErrorMessage​(SVNURL host,
                                                                java.lang.String path,
                                                                HTTPStatus status,
                                                                java.lang.String context,
                                                                java.lang.Object[] contextObjects)
      • setKeepAlive

        public void setKeepAlive​(boolean isKeepAlive)
      • setCookies

        public void setCookies​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> cookieHeader)