Package org.w3c.jigsaw.frames

Examples of org.w3c.jigsaw.frames.HTTPFrame


      // verify that the target resource is putable
      ResourceReference rr = request.getTargetResource();
      if (rr != null) {
    try {
        FramedResource target = (FramedResource) rr.lock();
        HTTPFrame frame = null;
        try {
      frame = (HTTPFrame) target.getFrame(
          Class.forName("org.w3c.jigsaw.frames.HTTPFrame"));
        } catch (ClassNotFoundException cex) {
      cex.printStackTrace();
        //big big problem ...
        }
        if (frame == null) // can't be putable
      return null;
        // now we can verify if the target resource is putable
        if (! frame.getPutableFlag()) {
      return null;
        }
        // and that the PUT can happen (taken from putFileResource
        int cim = frame.checkIfMatch(request);
        if ((cim == HTTPFrame.COND_FAILED)
      || (cim == HTTPFrame.COND_WEAK)
      || (frame.checkIfNoneMatch(request) ==
          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;
View Full Code Here

TOP

Related Classes of org.w3c.jigsaw.frames.HTTPFrame

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.