01: // DAVPropertyUpdate.java
02: // $Id: DAVPropertyUpdate.java,v 1.5 2000/10/16 12:30:22 bmahe Exp $
03: // (c) COPYRIGHT MIT, INRIA and Keio, 2000.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05: package org.w3c.www.webdav.xml;
06:
07: import java.util.Vector;
08:
09: import org.w3c.dom.Element;
10: import org.w3c.dom.Node;
11:
12: import org.w3c.www.webdav.WEBDAV;
13:
14: /**
15: * @version $Revision: 1.5 $
16: * @author Benoît Mahé (bmahe@w3.org)
17: */
18: public class DAVPropertyUpdate extends DAVNode {
19:
20: public DAVPropAction[] getActions() {
21: Vector v = new Vector();
22: Node current = element.getFirstChild();
23: while (current != null) {
24: if ((current.getNodeType() == current.ELEMENT_NODE)
25: && (current.getLocalName().equals(SET_NODE) || current
26: .getLocalName().equals(REMOVE_NODE))
27: && (current.getNamespaceURI() != null)
28: && (current.getNamespaceURI()
29: .equals(WEBDAV.NAMESPACE_URI))) {
30: v.addElement(new DAVPropAction((Element) current));
31: }
32: current = current.getNextSibling();
33: }
34: DAVPropAction dpa[] = new DAVPropAction[v.size()];
35: v.copyInto(dpa);
36: return dpa;
37: }
38:
39: public void setActions(DAVPropAction actions[]) {
40: int len = actions.length;
41: for (int i = 0; i < len; i++) {
42: element.appendChild(actions[i].getNode());
43: }
44: }
45:
46: DAVPropertyUpdate(Element element) {
47: super(element);
48: }
49:
50: }
|