001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.webdav;
016    
017    import com.liferay.portal.kernel.webdav.methods.MethodFactory;
018    import com.liferay.portal.model.Lock;
019    
020    import java.util.List;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     * @author Alexander Chow
025     */
026    public interface WebDAVStorage {
027    
028            public int copyCollectionResource(
029                            WebDAVRequest webDAVRequest, Resource resource, String destination,
030                            boolean overwrite, long depth)
031                    throws WebDAVException;
032    
033            public int copySimpleResource(
034                            WebDAVRequest webDAVRequest, Resource resource, String destination,
035                            boolean overwrite)
036                    throws WebDAVException;
037    
038            public int deleteResource(WebDAVRequest webDAVRequest)
039                    throws WebDAVException;
040    
041            public MethodFactory getMethodFactory();
042    
043            public Resource getResource(WebDAVRequest webDAVRequest)
044                    throws WebDAVException;
045    
046            public List<Resource> getResources(WebDAVRequest webDAVRequest)
047                    throws WebDAVException;
048    
049            public String getRootPath();
050    
051            public String getToken();
052    
053            public boolean isAvailable(WebDAVRequest webDAVRequest)
054                    throws WebDAVException;
055    
056            public boolean isSupportsClassTwo();
057    
058            public Status lockResource(
059                            WebDAVRequest webDAVRequest, String owner, long timeout)
060                    throws WebDAVException;
061    
062            public Status makeCollection(WebDAVRequest webDAVRequest)
063                    throws WebDAVException;
064    
065            public int moveCollectionResource(
066                            WebDAVRequest webDAVRequest, Resource resource, String destination,
067                            boolean overwrite)
068                    throws WebDAVException;
069    
070            public int moveSimpleResource(
071                            WebDAVRequest webDAVRequest, Resource resource, String destination,
072                            boolean overwrite)
073                    throws WebDAVException;
074    
075            public int putResource(WebDAVRequest webDAVRequest) throws WebDAVException;
076    
077            public Lock refreshResourceLock(
078                            WebDAVRequest webDAVRequest, String uuid, long timeout)
079                    throws WebDAVException;
080    
081            public void setRootPath(String rootPath);
082    
083            public void setToken(String token);
084    
085            public boolean unlockResource(WebDAVRequest webDAVRequest, String token)
086                    throws WebDAVException;
087    
088    }