Package org.w3c.jigsaw.http

Examples of org.w3c.jigsaw.http.Reply


     */

    public Reply put(Request request)
  throws ProtocolException, ResourceException
    {
  Reply error = request.makeReply(HTTP.NOT_IMPLEMENTED) ;
  error.setContent("Method PUT not implemented for zipped document") ;
  throw new HTTPException (error) ;
    }
View Full Code Here


         , Attribute.EDITABLE|Attribute.MANDATORY);
  ATTR_STRICT = AttributeRegistry.registerAttribute(c, a);
    }

    private Reply notifyFailure(Request request, boolean no_size) {
  Reply er = null;
  if (request.getExpect() != null)
      er = request.makeReply(HTTP.EXPECTATION_FAILED);
  else {
      if (no_size)
    er = request.makeReply(HTTP.LENGTH_REQUIRED);
      else
    er = request.makeReply(HTTP.REQUEST_ENTITY_TOO_LARGE);
  }
  er.setContent("<P>You are not allowed to PUT documents more than " +
          getInt(ATTR_PUTSIZE, -1) + " bytes long</P>");
  return er;
    }
View Full Code Here

     */

    public void authenticate (Request request)
  throws ProtocolException
    {
  Reply error = request.makeReply(HTTP.UNAUTHORIZED) ;
  error.setContent ("<p>Invalid server configuration</p>"
        + "<p>The server defines an authentication filter "
        + " with no <strong>authenticate</strong> method.");
  throw new HTTPException (error) ;
    }
View Full Code Here

     */

    public ReplyInterface outgoingFilter(RequestInterface request,
           ReplyInterface reply)
    {
      Reply rep = (Reply) reply;
  if ( getPrivateCachability() ) {
      rep.setMustRevalidate(true);
  } else if ( getSharedCachability() ) {
      rep.setProxyRevalidate(true);
  } else if ( getPublicCachability() ) {
      rep.setPublic(true);
  }
  return null;
    }
View Full Code Here

      try {
    loc = new URL(req.getURL(), result);
      } catch (MalformedURLException ex) {
    return null;
      }
      Reply reply = req.makeReply(HTTP.FOUND);
      reply.setLocation(loc);
      HtmlGenerator g = new HtmlGenerator("Moved");
      g.append("<P>This resource has moved, click  if your browser"
         + " doesn't support automatic redirection<BR>"+
         "<A HREF=\""+loc.toExternalForm()+"\">"+
         loc.toExternalForm()+"</A>");
      reply.setStream(g);
      return reply ;
  }
  return null;
    }
View Full Code Here

     */

    public Reply get(Request request)
  throws ProtocolException, ResourceException
    {
  Reply reply = createDefaultReply(request, HTTP.OK);
  reply.setStream(generateForm());
  return reply;
    }
View Full Code Here

      g.append("You were not allowed to change the password for user \""
         , username
         , "\".");
  }
  // We always succeed, that's cool:
  Reply reply = createDefaultReply(request, HTTP.OK);
  reply.setStream(g);
  return reply;
    }
View Full Code Here

      }
  }
  if (!authorized) {
      HttpChallenge challenge =
    security.getChallenge(acl.getName(), princ);
      Reply e = null;
      if ( request.isProxy() ) {
    e = request.makeReply(HTTP.PROXY_AUTH_REQUIRED);
    e.setProxyAuthenticate(challenge);
      } else {
    e = request.makeReply(HTTP.UNAUTHORIZED);
    e.setWWWAuthenticate(challenge);
      }
      HtmlGenerator g = new HtmlGenerator("Unauthorized");
      g.append ("<h1>Unauthorized access</h1>"+
          "<p>You are denied access to this resource.");
      e.setStream(g);
      request.skipBody();
      throw new HTTPException (e);
  } else {
      security.updateRequestStates(request, princ);
  }
View Full Code Here

     * @return Always <strong>null</strong>.
     */
    public ReplyInterface outgoingFilter(RequestInterface request,
           ReplyInterface reply)
    {
      Reply rep = (Reply) reply;
  if ( getPrivateCachability() ) {
      rep.setMustRevalidate(true);
  } else if ( getSharedCachability() ) {
      rep.setProxyRevalidate(true);
  } else if ( getPublicCachability() ) {
      rep.setPublic(true);
  }
  security.updateReply(rep, (Request) request);
  return null;
    }
View Full Code Here

  String args[] = { classFile.getAbsolutePath() };
  PageCompileOutputStream out = new PageCompileOutputStream();
  if (! compiler.compile(args, out)) {
      //FIXME Warning
      if (out.size() > 0) {
    Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
    error.setStream(out.getInputStream());
    error.setContentLength(out.size());
    error.setContentType(MimeType.TEXT_PLAIN);
    throw new HTTPException(error);
      }
  }
  //load class now
  try {
View Full Code Here

TOP

Related Classes of org.w3c.jigsaw.http.Reply

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.