Package org.apache.webdav.lib

Examples of org.apache.webdav.lib.PropertyName


            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


     */
    static public SourceProperty getProperty(String uri, String name, String namespace)
    throws HttpException, IOException {

        Vector propNames = new Vector(1);
        propNames.add(new PropertyName(namespace,name));
        Enumeration props= null;
        Property prop = null;
        WebdavResource resource = WebDAVUtil.getWebdavResource(uri);
        Enumeration responses = resource.propfindMethod(0, propNames);
        while (responses.hasMoreElements()) {
View Full Code Here

     */
    static public void setProperty(String uri, String name, String namespace, String value)
    throws HttpException, IOException {

        WebdavResource resource = WebDAVUtil.getWebdavResource(uri);
        if(!resource.proppatchMethod(new PropertyName(namespace, name), value, true)) {
            throw new HttpException("Error setting property " + namespace + ":" + name + " on resource: " + uri
                                    + " Status: " + resource.getStatusCode()
                                    + " Message: " + resource.getStatusMessage());
        }
    }
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

                    } 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
            {
                throw new IllegalArgumentException("Invalid object given for property.");
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
                // ignore
            }
View Full Code Here

                if (types[i].equals(principal)) {
                    found = true;
                    if ("property".equals(principal)) {
                        printer.writeElement("D", null, principal,
                                             XMLPrinter.OPENING);
                        PropertyName property = ace.getProperty();
                        String nsURI = property.getNamespaceURI();
                        if ("DAV:".equals(nsURI)) {
                            printer.writeElement("D", null,
                                                 property.getLocalName(),
                                                 XMLPrinter.NO_CONTENT);
                        } else {
                            printer.writeElement("Z", nsURI,
                                                 property.getLocalName(),
                                                 XMLPrinter.NO_CONTENT);
                        }
                        printer.writeElement("D", null, principal,
                                             XMLPrinter.CLOSING);
                    } else {
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

        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

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.