01: /*
02: * (C) Copyright Simulacra Media Ltd, 2004. All rights reserved.
03: *
04: * The program is provided "AS IS" without any warranty express or
05: * implied, including the warranty of non-infringement and the implied
06: * warranties of merchantibility and fitness for a particular purpose.
07: * Simulacra Media Ltd will not be liable for any damages suffered by you as a result
08: * of using the Program. In no event will Simulacra Media Ltd be liable for any
09: * special, indirect or consequential damages or lost profits even if
10: * Simulacra Media Ltd has been advised of the possibility of their occurrence.
11: * Simulacra Media Ltd will not be liable for any third party claims against you.
12: *
13: */
14: package com.ibm.webdav.protocol.http;
15:
16: import java.util.logging.*;
17:
18: import javax.servlet.http.*;
19:
20: import com.ibm.webdav.*;
21:
22: /**
23: * Executes the WebDAV Delta-V UncheckOut method.
24: *
25: * @author Michael Bell
26: * @version $Revision: 1.1 $
27: * @since November 18, 2003
28: */
29: public class UncheckOutMethod extends WebDAVMethod {
30: private static Logger m_logger = Logger
31: .getLogger(UncheckOutMethod.class.getName());
32:
33: public static String METHOD_NAME = "UNCHECKOUT";
34:
35: /**
36: * @param request
37: * @param response
38: * @throws WebDAVException
39: */
40: public UncheckOutMethod(HttpServletRequest request,
41: HttpServletResponse response) throws WebDAVException {
42: super (request, response);
43: methodName = METHOD_NAME;
44: }
45:
46: /* (non-Javadoc)
47: * @see com.ibm.webdav.protocol.http.WebDAVMethod#execute()
48: */
49: public WebDAVStatus execute() throws WebDAVException {
50: setStatusCode(WebDAVStatus.SC_CREATED); // the default status code
51: try {
52:
53: context.setMethodName(METHOD_NAME);
54: resource.uncheckout();
55:
56: setResponseHeaders();
57:
58: } catch (WebDAVException exc) {
59: m_logger.log(Level.INFO, exc.getMessage() + " - "
60: + request.getQueryString());
61: setStatusCode(exc.getStatusCode());
62:
63: } catch (Exception exc) {
64: m_logger.log(Level.WARNING, exc.getMessage(), exc);
65: setStatusCode(WebDAVStatus.SC_INTERNAL_SERVER_ERROR);
66: }
67: return context.getStatusCode();
68: }
69:
70: }
|