1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.webdav.methods;
16  
17  import com.liferay.portal.kernel.util.StringUtil;
18  import com.liferay.portal.webdav.WebDAVException;
19  import com.liferay.portal.webdav.WebDAVRequest;
20  
21  /**
22   * <a href="Method.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   * @author Alexander Chow
26   */
27  public interface Method {
28  
29      public static final String COPY = "COPY";
30  
31      public static final String DELETE = "DELETE";
32  
33      public static final String GET = "GET";
34  
35      public static final String HEAD = "HEAD";
36  
37      public static final String LOCK = "LOCK";
38  
39      public static final String MKCOL = "MKCOL";
40  
41      public static final String MOVE = "MOVE";
42  
43      public static final String OPTIONS = "OPTIONS";
44  
45      public static final String PROPFIND = "PROPFIND";
46  
47      public static final String PROPPATCH = "PROPPATCH";
48  
49      public static final String PUT = "PUT";
50  
51      public static final String UNLOCK = "UNLOCK";
52  
53      public static final String[] SUPPORTED_METHODS_ARRAY = {
54          COPY, DELETE, GET, HEAD, LOCK, MKCOL, MOVE, OPTIONS, PROPFIND,
55          PROPPATCH, PUT, UNLOCK
56      };
57  
58      public static final String SUPPORTED_METHODS =
59          StringUtil.merge(SUPPORTED_METHODS_ARRAY);
60  
61      /**
62       * Returns -1 or a supported HTTP status code. If it is -1, then the status
63       * code has already been set. Otherwise, the status code needs to be set by
64       * the caller.
65       *
66       * @return -1 or a supported HTTP status code. If it is -1, then the status
67       *         code has already been set. Otherwise, the status code needs to be
68       *         set by the caller.
69       */
70      public int process(WebDAVRequest webDavRequest) throws WebDAVException;
71  
72  }