Package org.apache.webdav.lib

Examples of org.apache.webdav.lib.PropertyName


     */
    public SourceProperty getSourceProperty (String namespace, String name)
    throws SourceException {

          Vector propNames = new Vector(1);
          propNames.add(new PropertyName(namespace,name));
          Enumeration props= null;
          org.apache.webdav.lib.Property prop = null;
          try {
              Enumeration responses = this.resource.propfindMethod(0, propNames);
              while (responses.hasMoreElements()) {
View Full Code Here


     */
    public void removeSourceProperty(String namespace, String name)
    throws SourceException {

        try {
            this.resource.proppatchMethod(new PropertyName(namespace, name), "", false);
        } catch (Exception e) {
            throw new SourceException("Could not remove property ", e);
        }
    }
View Full Code Here

            format.put(OutputKeys.METHOD, "xml");
            format.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
            String prop = XMLUtils.serializeNode(node, format);
           
            this.resource.proppatchMethod(
                   new PropertyName(sourceproperty.getNamespace(),sourceproperty.getName()),
                   prop, true);

        } catch(HttpException e) {
            final String message =
                "Unable to set property. Server responded " +
View Full Code Here

    }

  private Property getProperty(URI uri, String namespace, String name, Credentials credentials) throws IOException {
    String url = domain+uri.toString();
        Vector props = new Vector();
        props.add(new PropertyName(namespace, name));
        PropFindMethod propfindMethod = new PropFindMethod(url, 0, props.elements());
        propfindMethod.setDoAuthentication(true);
        HttpState httpState = new HttpState();
        httpState.setCredentials(null, host, credentials);
        int state = propfindMethod.execute(httpState, new HttpConnection(host, port, protocol));
View Full Code Here

                    } else {
                        i++;
                    }
                }
                if ((i == 1) || (i >= length)) {
                    list.add(new PropertyName("DAV:",propertyName));
                } else {
                    String namespace = propertyName.substring(0, length + 1 - i);
                    String localName = propertyName.substring(length + 1 - i);
                    list.add(new PropertyName(namespace,localName));
                }
            }
            else
            {
                // unknown type
View Full Code Here

        String name=prop;
        try {
            out.print("Putting property(" + name + ", " + value +
                ") to '" + path + "': ");
            if (webdavResource.proppatchMethod(
                path, new PropertyName("DAV:",name), value, true)) {
                out.println("succeeded.");
            } else {
                out.println("failed.");
                out.println(webdavResource.getStatusMessage());
            }
View Full Code Here

      resource.setDebug(Constant.DEBUG_LEVEL);

      /* Create draft mail (XML request) */
      Hashtable<Object, String> props = new Hashtable<Object, String>();
      // <a:contentclass>urn:content-classes:message</a:contentclass>
      props.put(new PropertyName(namespace.get("a"), "contentclass"),
          "urn:content-classes:message");
      // <h:outlookmessageclass>IPM.Note</h:outlookmessageclass>
      props.put(new PropertyName(namespace.get("h"),
          "outlookmessageclass"), "IPM.Note");
      // <d:to>foo@foobar.com</d:to>
      props.put(new PropertyName(namespace.get("d"), "to"),
          "dominique.righetto@laposte.net");
      // <d:cc>bar@foobar.com</d:cc>
      props.put(new PropertyName(namespace.get("d"), "cc"),
          "neotux@laposte.net");
      // <d:importance>High</d:importance>
      props.put(new PropertyName(namespace.get("d"), "importance"),
          "High");
      // <d:bcc>bob@aol.com</d:bcc>
      props
          .put(new PropertyName(namespace.get("d"), "bcc"),
              "dri@flc.be");
      // <g:subject>$subject</g:subject>
      props.put(new PropertyName(namespace.get("g"), "subject"), "Test");
      // <e:htmldescription>This is spam. Please delete this
      // email.</e:htmldescription>
      props.put(new PropertyName(namespace.get("e"), "htmldescription"),
          "This is spam. Please delete this email.");

      /* Send webdav request and read response... */
      if (resource.proppatchMethod(Constant.DAV_URL + "Drafts/Test_"
          + idDateFormat.format(new Date()) + ".EML", props, true)) {
View Full Code Here

      resource = new WebdavResource(url);
      resource.setDebug(Constant.DEBUG_LEVEL);

      /* Create task (XML request) */
      Hashtable<Object, String> props = new Hashtable<Object, String>();
      props.put(new PropertyName(namespace.get("a"), "contentclass"),
          "urn:content-classes:task");
      props.put(new PropertyName(namespace.get("h"),
          "outlookmessageclass"), "IPM.Task");
      props.put(new PropertyName(namespace.get("d"), "subject"),
          "TestTask");
      props.put(new PropertyName(namespace.get("d"), "importance"),
          "High");
      props.put(new PropertyName(namespace.get("e"), "textdescription"),
          "This is spam Task. Please delete this task.");
      // Priority : 0 = Low ; 1 = Normal ; 2 = High
      props.put(new PropertyName(namespace.get("h"), "x-priority-long"),
          "1");     
      props.put(new PropertyName(namespace.get("m"), "dtdue"), dateFormat
          .format(new Date()));
      props.put(new PropertyName(namespace.get("m"), "dtstart"),
          dateFormat.format(new Date()));
      props.put(new PropertyName(namespace.get("m"), "percentcomplete"),
          "0.5");
      // Status : 0 = Not Started ; 1 = In Progress ; 2 = Completed ;
      // 3 = Waiting on someone else ; 4 = Deferred
      props.put(new PropertyName(namespace.get("m"), "status"), "2");
      props.put(new PropertyName(namespace.get("g"), "reminderset"), "1");
      props.put(new PropertyName(namespace.get("g"), "remindertime"),
          dateFormat.format(new Date()));

      /* Send webdav request and read response... */
      if (resource.proppatchMethod(Constant.DAV_URL + "Tasks/Test_"
          + idDateFormat.format(new Date()) + ".EML", props, true)) {
View Full Code Here

     */
    public void removeSourceProperty(String namespace, String name)
    throws SourceException {

        try {
            this.resource.proppatchMethod(new PropertyName(namespace, name), "", false);
        } catch (Exception e) {
            throw new SourceException("Could not remove property ", e);
        }
    }
View Full Code Here

            format.put(OutputKeys.METHOD, "xml");
            format.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
            String prop = XMLUtils.serializeNode(frag, format);
           
            this.resource.proppatchMethod(
                   new PropertyName(sourceproperty.getNamespace(),sourceproperty.getName()),
                   prop, true);
        } catch (Exception e) {
            throw new SourceException("Could not set property ", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.webdav.lib.PropertyName

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.