Package org.w3c.jigsaw.http

Examples of org.w3c.jigsaw.http.Request.makeReply()


      c_b.setTime(new Date(getLong(ATTR_DATE_END, -1)));
      if (cal.before(c_a)) {
    reply = request.makeReply(HTTP.SERVICE_UNAVAILABLE);
    reply.setRetryAfter(c_a.getTime().getTime());
      } else if (cal.after(c_b)) {
    reply = request.makeReply(HTTP.SERVICE_UNAVAILABLE);
      }
  }
  if (reply != null) {
      HtmlGenerator g = new HtmlGenerator("Service Unavailable");
      g.append("You may retry after the delay or the date given");
View Full Code Here


      request.setProxy(true);
      lr.setTarget(this.getResource().getResourceReference());
      return true;
  }
  // Emit a not found:
  Reply error = request.makeReply(HTTP.NOT_FOUND);
  if (request.getMethod().equals("GET"))
      error.setContent("Target resource not found.");
  lr.setTarget(null);
  lr.setReply(error);
  return true;
View Full Code Here

      case PutListResource.FILE_UC:
      case PutListResource.FILE_PB:
      case PutListResource.FILE_DEL:
    return null;
      case PutListResource.FILE_MG:
    Reply   msg = request.makeReply(HTTP.CONFLICT);
    HtmlGenerator g = getHtmlGenerator("Warning");
    g.append ("<H1>Warning</H1> The file on publish space has "+
        "been modified directly but attempting to merge "+
        "has succeed.<p>"+
        "You should update the file before editing "+
View Full Code Here

        "You should update the file before editing "+
        "it again.");
    msg.setStream(g);
    return msg;
      case PutListResource.FILE_CF:
    Reply error = request.makeReply(HTTP.CONFLICT);
    HtmlGenerator gerr = getHtmlGenerator("Warning");
    gerr.append ("<H1>Warning</H1> The file on publish space has "+
           "been modified directly and attempting to merge"+
           " has failed.<p>"+
           "Ask your system administrator.");
View Full Code Here

          HTTPFrame.COND_FAILED)
      || (frame.checkIfModifiedSince(request) ==
          HTTPFrame.COND_FAILED)
      || (frame.checkIfUnmodifiedSince(request) ==
          HTTPFrame.COND_FAILED)) {
      Reply r = request.makeReply(HTTP.PRECONDITION_FAILED);
      r.setContent("Pre-condition failed.");
      return r;
        }
    } catch (InvalidResourceException ex) {
        ex.printStackTrace();
View Full Code Here

        }
    }
      }
      String found = searchForbiddenStrings(in);
      if (found != null) {
    Reply error = request.makeReply(HTTP.FORBIDDEN);
    error.setReason("the string \""+found+"\" is forbidden.");
    error.setContent ("<p>the string \""+found+
          "\" is forbidden.</p><br> click "+
          "<A HREF=\""+getRedirectURL()+"\">here</A>"+
          " for explaination.");
View Full Code Here

    public ReplyInterface perform(RequestInterface req)
  throws ProtocolException, ResourceException
    {
  if (putlist == null) {
      Request request = (Request) req;
      Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
      error.setContent("The PutListFrame must be associated "+
           "with a PutListResource only!!");
      throw new HTTPException(error);
  }
  return super.perform(req);
View Full Code Here

          HTTPFrame.COND_FAILED)
      || (frame.checkIfModifiedSince(request) ==
          HTTPFrame.COND_FAILED)
      || (frame.checkIfUnmodifiedSince(request) ==
          HTTPFrame.COND_FAILED)) {
      Reply r = request.makeReply(HTTP.PRECONDITION_FAILED);
      r.setContent("Pre-condition failed.");
      return r;
        }
    } catch (InvalidResourceException ex) {
        ex.printStackTrace();
View Full Code Here

        }
    }
      }
      String found = searchForbiddenStrings(in);
      if (found != null) {
    Reply error = request.makeReply(HTTP.FORBIDDEN);
    error.setReason("the string \""+found+"\" is forbidden.");
    error.setContent ("<p>the string \""+found+
          "\" is forbidden.</p><br> click "+
          "<A HREF=\""+getRedirectURL()+"\">here</A>"+
          " for explaination.");
View Full Code Here

      || (frame.checkIfModifiedSince(request) ==
          HTTPFrame.COND_FAILED)
      || (frame.checkIfUnmodifiedSince(request) ==
          HTTPFrame.COND_FAILED)) {
     
      Reply r = request.makeReply(HTTP.PRECONDITION_FAILED);
      r.setContent("Pre-condition failed.");
      return r;
        }
    } catch (InvalidResourceException ex) {
        ex.printStackTrace();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.