Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public InternalJettyServletRequest(String method, org.eclipse.jetty.http.HttpURI uri, String body, javax.servlet.http.Cookie[] cookies, String contentType, String encoding, InternalJettyServletResponse res, RequestData requestData) throws java.io.UnsupportedEncodingException
        public InternalJettyServletRequest(string method, HttpURI uri, string body, Cookie[] cookies, string contentType, string encoding, InternalJettyServletResponse res, RequestData requestData) : base(null, null)
        {
            this._input       = new Input(this, body);
            this._inputReader = new StreamReader(new StringReader(body));

            this._contentType = contentType;
            this._cookies     = cookies;
            this._method      = method;
            this._response    = res;
            this._requestData = requestData;

            this._headers = new Dictionary <string, object>();

            CharacterEncoding = encoding;
            DispatcherType    = DispatcherType.REQUEST;

            MetaData.Request request = new MetaData.Request(new HttpFields());
            request.Method = method;
            request.URI    = uri;
            MetaData       = request;
        }
Example #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected void invoke(String method, String path, String body, System.Nullable<int> id, java.net.URI targetUri, InternalJettyServletRequest req, InternalJettyServletResponse res) throws java.io.IOException
        protected internal override void Invoke(string method, string path, string body, int?id, URI targetUri, InternalJettyServletRequest req, InternalJettyServletResponse res)
        {
            _results.startOperation(path, id);
            try
            {
                res = new BatchInternalJettyServletResponse(_results.ServletOutputStream);
                WebServer.invokeDirectly(targetUri.Path, req, res);
            }
            catch (Exception e)
            {
                _logger.warn(e);
                _results.writeError(500, e.Message);
                throw new BatchOperationFailedException(500, e.Message, e);
            }
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int status = res.getStatus();
            int status = res.Status;

            if (Is2XXStatusCode(status))
            {
                _results.addOperationResult(status, id, res.GetHeader("Location"));
            }
            else
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String message = "Error " + status + " executing batch operation: " + ((id != null) ? id + ". " : "") + method + " " + path + " " + body;
                string message = "Error " + status + " executing batch operation: " + ((id != null) ? id + ". " : "") + method + " " + path + " " + body;
                _results.writeError(status, res.Reason);
                throw new BatchOperationFailedException(status, message, new Exception(res.Reason));
            }
        }
Example #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public InternalJettyServletRequest(String method, String uri, String body, InternalJettyServletResponse res, RequestData requestData) throws java.io.UnsupportedEncodingException
        public InternalJettyServletRequest(string method, string uri, string body, InternalJettyServletResponse res, RequestData requestData) : this(method, new HttpURI(uri), body, new Cookie[] {}, MediaType.APPLICATION_JSON, StandardCharsets.UTF_8.name(), res, requestData)
        {
        }
Example #4
0
 public Output(InternalJettyServletResponse outerInstance)
 {
     this._outerInstance = outerInstance;
 }