01: /**
02: * Copyright (c) 2000/2001 Thomas Kopp
03: * All rights reserved.
04: *
05: * Redistribution and use in source and binary forms, with or without
06: * modification, are permitted provided that the following conditions
07: * are met:
08: * 1. Redistributions of source code must retain the above copyright
09: * notice, this list of conditions and the following disclaimer.
10: * 2. Redistributions in binary form must reproduce the above copyright
11: * notice, this list of conditions and the following disclaimer in the
12: * documentation and/or other materials provided with the distribution.
13: *
14: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17: * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24: * SUCH DAMAGE.
25: */package org.w3c.jigsaw.webdavs;
26:
27: import java.net.URL;
28:
29: import org.w3c.jigsaw.daemon.ServerHandlerInitException;
30: import org.w3c.jigsaw.https.SSLAdapter;
31: import org.w3c.jigsaw.webdav.webdavd;
32:
33: import org.w3c.tools.resources.ReplyInterface;
34: import org.w3c.tools.resources.RequestInterface;
35: import org.w3c.tools.resources.ResourceException;
36: import org.w3c.tools.resources.ProtocolException;
37:
38: /**
39: * @author Thomas Kopp, Dialogika GmbH
40: * @version 1.0.2, 30 January 2001
41: *
42: * This class extends a Jigsaw webdav daemon
43: * in order to supply a Jigsaw webdav daemon with https support
44: * in accordance with the JSSE API.
45: */
46: public class webdavsd extends webdavd {
47:
48: /**
49: * reference to the TLS support adapter of this daemon
50: */
51: private SSLAdapter adapter = null;
52:
53: /**
54: * constructor of this daemon
55: */
56: public webdavsd() {
57: super ();
58: adapter = new SSLAdapter(this );
59: }
60:
61: /**
62: * clone method of this daemon
63: */
64: protected Object clone() throws CloneNotSupportedException {
65: webdavsd daemon = (webdavsd) (super .clone());
66: daemon.adapter = new SSLAdapter(daemon);
67: return daemon;
68: }
69:
70: /**
71: * method for initializing the properties of this daemon
72: * @exception ServerHandlerInitException if initialization fails
73: */
74: protected void initializeProperties()
75: throws ServerHandlerInitException {
76: super .initializeProperties();
77: adapter.initializeProperties();
78: }
79:
80: /**
81: * method for supplying a reply interface of a request
82: * @param req current request to be handled
83: * @return reply for a current request
84: */
85: public ReplyInterface perform(RequestInterface req)
86: throws ProtocolException, ResourceException {
87: adapter.perform(req);
88: return super .perform(req);
89: }
90:
91: /**
92: * method for supplying the uri of this daemon
93: * @return uri of this daemon
94: */
95: public URL getURL() {
96: return adapter.getURL();
97: }
98: }
|