Source Code Cross Referenced for DAVFactory.java in  » Web-Server » Jigsaw » org » w3c » www » webdav » xml » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Jigsaw » org.w3c.www.webdav.xml 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // DAVFactory.java
002:        // $Id: DAVFactory.java,v 1.5 2000/10/16 12:30:22 bmahe Exp $
003:        // (c) COPYRIGHT MIT, INRIA and Keio, 2000.
004:        // Please first read the full copyright statement in file COPYRIGHT.html
005:        package org.w3c.www.webdav.xml;
006:
007:        import org.w3c.dom.Document;
008:        import org.w3c.dom.Element;
009:        import org.w3c.dom.Node;
010:
011:        import org.w3c.www.webdav.WEBDAV;
012:
013:        /**
014:         * @version $Revision: 1.5 $
015:         * @author  Benoît Mahé (bmahe@w3.org)
016:         */
017:        public class DAVFactory {
018:
019:            protected static Element createDAVElement(Document doc, String name) {
020:                Element el = doc.createElementNS(WEBDAV.NAMESPACE_URI,
021:                        WEBDAV.NAMESPACE_PREFIX + ":" + name);
022:                return el;
023:            }
024:
025:            /**
026:             * Create a DAVNode
027:             * @param el the DOM Element
028:             * @return a DAVNode instance
029:             */
030:            public static DAVNode createDAVNode(Element el) {
031:                return new DAVNode(el);
032:            }
033:
034:            /**
035:             * Create a DAVProperties node.
036:             * @param document the xml document
037:             * @return a DAVProperties instance
038:             */
039:            public static DAVProperties createProperties(Document document) {
040:                Element el = createDAVElement(document, DAVNode.PROP_NODE);
041:                return new DAVProperties(el);
042:            }
043:
044:            /**
045:             * Create a DAVProperties node.
046:             * @param element the prop node
047:             * @return a DAVProperties instance
048:             */
049:            public static DAVProperties createProperties(Element el) {
050:                return new DAVProperties(el);
051:            }
052:
053:            public static DAVPropStat createPropStat(String status,
054:                    Document document) {
055:                Element el = createDAVElement(document, DAVNode.PROPSTAT_NODE);
056:                DAVPropStat dps = new DAVPropStat(el);
057:                dps.setStatus(status);
058:                return dps;
059:            }
060:
061:            public static DAVPropStat createPropStat(String status,
062:                    String propname, Document document) {
063:                Element el = createDAVElement(document, DAVNode.PROPSTAT_NODE);
064:                DAVPropStat dps = new DAVPropStat(el);
065:                dps.setStatus(status);
066:                DAVProperties dp = createProperties(document);
067:                dp.addProperty(propname);
068:                dps.addDAVNode(dp);
069:                return dps;
070:            }
071:
072:            public static DAVPropStat createPropStatNS(String status,
073:                    Node node, Document document) {
074:                Element el = createDAVElement(document, DAVNode.PROPSTAT_NODE);
075:                DAVPropStat dps = new DAVPropStat(el);
076:                dps.setStatus(status);
077:                DAVProperties dp = createProperties(document);
078:                dp.addNodeNS(node);
079:                dps.addDAVNode(dp);
080:                return dps;
081:            }
082:
083:            public static DAVPropStat createPropStat(String status,
084:                    DAVProperties props, Document document) {
085:                Element el = createDAVElement(document, DAVNode.PROPSTAT_NODE);
086:                DAVPropStat dps = new DAVPropStat(el);
087:                dps.setStatus(status);
088:                dps.addDAVNode(props);
089:                return dps;
090:            }
091:
092:            public static DAVResponse createResponse(String url,
093:                    Document document) {
094:                Element el = createDAVElement(document, DAVNode.RESPONSE_NODE);
095:                DAVResponse dr = new DAVResponse(el);
096:                dr.addDAVNode(DAVNode.HREF_NODE, url);
097:                return dr;
098:            }
099:
100:            public static DAVResponse createResponse(String url, String status,
101:                    Document document) {
102:                Element el = createDAVElement(document, DAVNode.RESPONSE_NODE);
103:                DAVResponse dr = new DAVResponse(el);
104:                dr.addDAVNode(DAVNode.HREF_NODE, url);
105:                dr.addDAVNode(DAVNode.STATUS_NODE, status);
106:                return dr;
107:            }
108:
109:            public static DAVResponse createResponse(String url, String status,
110:                    String description, Document document) {
111:                Element el = createDAVElement(document, DAVNode.RESPONSE_NODE);
112:                DAVResponse dr = new DAVResponse(el);
113:                dr.addDAVNode(DAVNode.HREF_NODE, url);
114:                dr.addDAVNode(DAVNode.STATUS_NODE, status);
115:                dr.addDAVNode(DAVNode.RESPONSEDESC_NODE, description);
116:                return dr;
117:            }
118:
119:            public static DAVResponse createPropStatResponse(String url,
120:                    String status, DAVProperties props, Document document) {
121:                DAVPropStat dps = createPropStat(status, props, document);
122:                Element el = createDAVElement(document, DAVNode.RESPONSE_NODE);
123:                DAVResponse dr = new DAVResponse(el);
124:                dr.addDAVNode(DAVNode.HREF_NODE, url);
125:                dr.addDAVNode(dps);
126:                return dr;
127:            }
128:
129:            public static DAVPropAction createPropAction(int type,
130:                    DAVProperties props, Document document) {
131:                Element el = null;
132:                if (type == DAVPropAction.SET) {
133:                    el = createDAVElement(document, DAVNode.SET_NODE);
134:                } else {
135:                    el = createDAVElement(document, DAVNode.REMOVE_NODE);
136:                }
137:                el.appendChild(props.getNode());
138:                return new DAVPropAction(el);
139:            }
140:
141:            public static DAVPropertyUpdate createPropertyUpdate(
142:                    DAVPropAction act[], Document document) {
143:                Element el = createDAVElement(document,
144:                        DAVNode.PROPERTYUPDATE_NODE);
145:                DAVPropertyUpdate dpu = new DAVPropertyUpdate(el);
146:                dpu.setActions(act);
147:                return dpu;
148:            }
149:
150:            public static DAVPropertyUpdate createPropertyUpdate(
151:                    DAVPropAction act, Document document) {
152:                Element el = createDAVElement(document,
153:                        DAVNode.PROPERTYUPDATE_NODE);
154:                DAVPropertyUpdate dpu = new DAVPropertyUpdate(el);
155:                DAVPropAction array[] = { act };
156:                dpu.setActions(array);
157:                return dpu;
158:            }
159:
160:            public static DAVPropertyUpdate createPropertyUpdate(Element el,
161:                    DAVPropAction act) {
162:                DAVPropertyUpdate dpu = new DAVPropertyUpdate(el);
163:                DAVPropAction array[] = { act };
164:                dpu.setActions(array);
165:                return dpu;
166:            }
167:
168:            public static DAVMultiStatus createMultiStatus(Element el) {
169:                return new DAVMultiStatus(el);
170:            }
171:
172:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.