1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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  }