Examples of DAVPropStat


Examples of org.w3c.www.webdav.xml.DAVPropStat

      if (n.getNodeType() == n.ELEMENT_NODE) {
    Element el = (Element)n;
    setDeadProperty(el);
    okdp.addNodeNS(document.importNode(el, false));
      } else {
    DAVPropStat dps = DAVFactory.createPropStatNS(
                getStatusLine(HTTP.CONFLICT),
                document.importNode(n, false),
                document);
    String msg = "Invalid XML : "+name;
    throw new DAVPropertyException(msg, dps);
      }
  } catch (DOMException ex) {
      DAVPropStat dps = DAVFactory.createPropStatNS(
            getStatusLine(HTTP.CONFLICT),
            document.importNode(n, false),
            document);
      throw new DAVPropertyException(ex.getMessage(), dps);
  }
View Full Code Here

Examples of org.w3c.www.webdav.xml.DAVPropStat

      try {
    MimeType mime = new MimeType(value);
    setValue(ATTR_CONTENT_TYPE, mime);
    okdp.addProperty(name);
      } catch (MimeTypeFormatException ex) {
    DAVPropStat dps = DAVFactory.createPropStat(
              getStatusLine(HTTP.CONFLICT),
              name,
              document);
    // throw exception now
    String msg = "Invalid value for "+name+" : "+value;
    throw new DAVPropertyException(msg, dps);
      }
  } else if (isReadOnly(name)) {
      // forbidden
      DAVPropStat dps = DAVFactory.createPropStat(
          getStatusLine(HTTP.FORBIDDEN),
          name,
          document);
      throw new DAVPropertyException(name+" cannot be modified", dps);
  } else {
View Full Code Here

Examples of org.w3c.www.webdav.xml.DAVPropStat

               document);
    }
      }
  } catch (DAVPropertyException ex) {
      // something failed
      DAVPropStat dps     = (DAVPropStat) ex.getReason();
      String      msg     = ex.getMessage();
      DAVPropStat stats[] = null;
      if (okdp.getNode().hasChildNodes()) {
    DAVPropStat okdps =
        DAVFactory.createPropStat(getStatusLine(HTTP.OK),
                okdp,
                document);
    stats = new DAVPropStat[2];
    stats[0] = okdps;
View Full Code Here

Examples of org.w3c.www.webdav.xml.DAVPropStat

      if (n.getNodeType() == n.ELEMENT_NODE) {
    Element el = (Element)n;
    removeDeadProperty(el);
    okdp.addNodeNS(document.importNode(el, false));
      } else {
    DAVPropStat dps = DAVFactory.createPropStatNS(
                getStatusLine(HTTP.CONFLICT),
                document.importNode(n, false),
                document);
    String msg = "Invalid XML : "+name;
    throw new DAVPropertyException(msg, dps);
      }
  } catch (DOMException ex) {
      DAVPropStat dps = DAVFactory.createPropStatNS(
            getStatusLine(HTTP.CONFLICT),
            document.importNode(n, false),
            document);
      throw new DAVPropertyException(ex.getMessage(), dps);
  }
View Full Code Here

Examples of org.w3c.www.webdav.xml.DAVPropStat

  if (body != null) {
      DAVPropertyUpdate dpu = body.getPropertyUpdate();
      if (dpu != null) {
    DAVPropAction dpas[] = dpu.getActions();
    DAVPropStat   dps    = null;
    int len = dpas.length;
    try {
        for (int i = 0 ; i < len ; i++) {
      DAVPropAction dpa = dpas[i];
      switch (dpa.getAction())
          {
          case DAVPropAction.SET:
        dps = setDAVProperties(
                   dpa.getProperties(),
                   document);
        break;
          case DAVPropAction.REMOVE:
        dps = removeDAVProperties(
                dpa.getProperties(),
                document);
        break;
          default:
        // error
        Reply error =
            request.makeReply(HTTP.BAD_REQUEST);
        error.setContent("Invalid request");
        throw new HTTPException (error);
          }
      if (dps != null) {
          dr.addDAVNode(dps);
      }
        }
        saveDeadProperties();
    } catch (DAVPropertyException ex) {
        // stop all an undo change
        reloadDeadProperties();
        this.values = oldvalues;
        // report error
        DAVPropStat dpss[] = (DAVPropStat[])ex.getReason();
        for (int j = 0 ; j < dpss.length ; j++) {
      dr.addDAVNode(dpss[j]);
        }
        dr.setDescription(ex.getMessage());
    }
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.