Package org.apache.util

Examples of org.apache.util.PropertyWriter


    /**
     * Get a String representation of the property.
     */
    public String toString () {
        StringWriter tmp = new StringWriter();
        PropertyWriter propertyWriter = new PropertyWriter(tmp, true);
        propertyWriter.print(element);
        return tmp.getBuffer().toString();
    }
View Full Code Here


    /**
     * Get a String representation of the property.
     */
    public String toString () {
        StringWriter tmp = new StringWriter();
        PropertyWriter propertyWriter = new PropertyWriter(tmp, true);
        propertyWriter.print(element);
        return tmp.getBuffer().toString();
    }
View Full Code Here

                case Node.ELEMENT_NODE:
                   
                    Property propertyToSet = getProperty(currentNode);
                   
                    StringWriter writer = new StringWriter();
                    propertyWriter = new PropertyWriter(writer, true);
                   
                    // Printing all child nodes using the DOM printer
                    NodeList childNodes = currentNode.getChildNodes();
                    Node childNode = childNodes.item(0);
                    int pos = 0;
View Full Code Here

                    (WebdavStatus.SC_INTERNAL_SERVER_ERROR);
            }
           
            NodeList childList = lockInfoNode.getChildNodes();
            StringWriter strWriter = null;
            PropertyWriter propertyWriter = null;
           
            Node lockScopeNode = null;
            Node lockTypeNode = null;
            Node lockOwnerNode = null;
           
            for (int i=0; i < childList.getLength(); i++) {
                Node currentNode = childList.item(i);
                switch (currentNode.getNodeType()) {
                case Node.TEXT_NODE:
                    break;
                case Node.ELEMENT_NODE:
                    String nodeName = currentNode.getNodeName();
                    if (nodeName.endsWith("lockscope")) {
                        lockScopeNode = currentNode;
                    }
                    if (nodeName.endsWith("locktype")) {
                        lockTypeNode = currentNode;
                    }
                    if (nodeName.endsWith("owner")) {
                        lockOwnerNode = currentNode;
                    }
                    break;
                }
            }
           
            if (lockScopeNode != null) {
               
                childList = lockScopeNode.getChildNodes();
                for (int i=0; i < childList.getLength(); i++) {
                    Node currentNode = childList.item(i);
                    switch (currentNode.getNodeType()) {
                    case Node.TEXT_NODE:
                        break;
                    case Node.ELEMENT_NODE:
                        String tempScope = currentNode.getNodeName();
                        if (tempScope.indexOf(':') != -1) {
                            lockInfo_lockScope = "<"
                                + tempScope.substring(tempScope.indexOf(':')
                                                      + 1) + "/>";
                        } else {
                            lockInfo_lockScope = "<" + tempScope + "/>";
                        }
//System.out.println("Lock scope : " + lockInfo_lockScope);
                        break;
                    }
                }
               
                if (lockInfo_lockScope == null) {
                    // Bad request
                    resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
                }
               
            } else {
                // Bad request
                resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
            }
           
            if (lockTypeNode != null) {
               
                childList = lockTypeNode.getChildNodes();
                for (int i=0; i < childList.getLength(); i++) {
                    Node currentNode = childList.item(i);
                    switch (currentNode.getNodeType()) {
                    case Node.TEXT_NODE:
                        break;
                    case Node.ELEMENT_NODE:
                        String tempType = currentNode.getNodeName();
                        if (tempType.indexOf(':') != -1) {
                            lockInfo_lockType = "<"
                                + tempType.substring(tempType.indexOf(':') + 1)
                                + "/>";
                        } else {
                            lockInfo_lockType = "<" + tempType + "/>";
                        }
//System.out.println("Lock type : " + lockInfo_lockType);
                        break;
                    }
                }
               
                if (lockInfo_lockType == null) {
                    // Bad request
                    resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
                }
               
            } else {
                // Bad request
                resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
            }
           
            if (lockOwnerNode != null) {
               
                childList = lockOwnerNode.getChildNodes();
                for (int i=0; i < childList.getLength(); i++) {
                    Node currentNode = childList.item(i);
                    switch (currentNode.getNodeType()) {
                    case Node.TEXT_NODE:
                        break;
                    case Node.ELEMENT_NODE:
                        strWriter = new StringWriter();
                        propertyWriter = new PropertyWriter(strWriter, true);
                        propertyWriter.print(currentNode);
                        lockInfo_lockOwner = strWriter.toString();
                        break;
                    }
                }
               
View Full Code Here

TOP

Related Classes of org.apache.util.PropertyWriter

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.