001    /**
002     * Copyright (c) 2000-2010 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.webdav.methods;
016    
017    import com.liferay.portal.kernel.util.StringUtil;
018    import com.liferay.portal.kernel.webdav.WebDAVException;
019    import com.liferay.portal.kernel.webdav.WebDAVRequest;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     * @author Alexander Chow
024     */
025    public interface Method {
026    
027            public static final String COPY = "COPY";
028    
029            public static final String DELETE = "DELETE";
030    
031            public static final String GET = "GET";
032    
033            public static final String HEAD = "HEAD";
034    
035            public static final String LOCK = "LOCK";
036    
037            public static final String MKCOL = "MKCOL";
038    
039            public static final String MOVE = "MOVE";
040    
041            public static final String OPTIONS = "OPTIONS";
042    
043            public static final String PROPFIND = "PROPFIND";
044    
045            public static final String PROPPATCH = "PROPPATCH";
046    
047            public static final String PUT = "PUT";
048    
049            public static final String UNLOCK = "UNLOCK";
050    
051            public static final String[] SUPPORTED_METHODS_ARRAY = {
052                    COPY, DELETE, GET, HEAD, LOCK, MKCOL, MOVE, OPTIONS, PROPFIND,
053                    PROPPATCH, PUT, UNLOCK
054            };
055    
056            public static final String SUPPORTED_METHODS =
057                    StringUtil.merge(SUPPORTED_METHODS_ARRAY);
058    
059            /**
060             * Returns -1 or a supported HTTP status code. If it is -1, then the status
061             * code has already been set. Otherwise, the status code needs to be set by
062             * the caller.
063             *
064             * @return -1 or a supported HTTP status code. If it is -1, then the status
065             *                 code has already been set. Otherwise, the status code needs to be
066             *                 set by the caller.
067             */
068            public int process(WebDAVRequest webDavRequest) throws WebDAVException;
069    
070    }