001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.webdav.methods;
016    
017    import com.liferay.portal.kernel.webdav.WebDAVException;
018    import com.liferay.portal.kernel.webdav.WebDAVRequest;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     * @author Alexander Chow
023     */
024    public interface Method {
025    
026            public static final String COPY = "COPY";
027    
028            public static final String DELETE = "DELETE";
029    
030            public static final String GET = "GET";
031    
032            public static final String HEAD = "HEAD";
033    
034            public static final String LOCK = "LOCK";
035    
036            public static final String MKCOL = "MKCOL";
037    
038            public static final String MOVE = "MOVE";
039    
040            public static final String OPTIONS = "OPTIONS";
041    
042            public static final String PROPFIND = "PROPFIND";
043    
044            public static final String PROPPATCH = "PROPPATCH";
045    
046            public static final String PUT = "PUT";
047    
048            public static final String[] SUPPORTED_METHOD_NAMES = {
049                    COPY, DELETE, GET, HEAD, LOCK, MKCOL, MOVE, OPTIONS, PROPFIND,
050                    PROPPATCH, PUT, Method.UNLOCK
051            };
052    
053            public static final String UNLOCK = "UNLOCK";
054    
055            /**
056             * Returns -1 or a supported HTTP status code. If it is -1, then the status
057             * code has already been set. Otherwise, the status code needs to be set by
058             * the caller.
059             *
060             * @param  webDAVRequest the WebDAV request
061             * @return -1 or a supported HTTP status code. If it is -1, then the status
062             *         code has already been set. Otherwise, the status code needs to be
063             *         set by the caller.
064             * @throws WebDAVException if a WebDAV exception occurred
065             */
066            public int process(WebDAVRequest webDAVRequest) throws WebDAVException;
067    
068    }