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     */
025    public class WebDAVStorageWrapper implements WebDAVStorage {
026    
027            public WebDAVStorageWrapper(WebDAVStorage webDAVStorage) {
028                    _webDAVStorage = webDAVStorage;
029            }
030    
031            @Override
032            public int copyCollectionResource(
033                            WebDAVRequest webDAVRequest, Resource resource, String destination,
034                            boolean overwrite, long depth)
035                    throws WebDAVException {
036    
037                    return _webDAVStorage.copyCollectionResource(
038                            webDAVRequest, resource, destination, overwrite, depth);
039            }
040    
041            @Override
042            public int copySimpleResource(
043                            WebDAVRequest webDAVRequest, Resource resource, String destination,
044                            boolean overwrite)
045                    throws WebDAVException {
046    
047                    return _webDAVStorage.copySimpleResource(
048                            webDAVRequest, resource, destination, overwrite);
049            }
050    
051            @Override
052            public int deleteResource(WebDAVRequest webDAVRequest)
053                    throws WebDAVException {
054    
055                    return _webDAVStorage.deleteResource(webDAVRequest);
056            }
057    
058            @Override
059            public MethodFactory getMethodFactory() {
060                    return _webDAVStorage.getMethodFactory();
061            }
062    
063            @Override
064            public Resource getResource(WebDAVRequest webDAVRequest)
065                    throws WebDAVException {
066    
067                    return _webDAVStorage.getResource(webDAVRequest);
068            }
069    
070            @Override
071            public List<Resource> getResources(WebDAVRequest webDAVRequest)
072                    throws WebDAVException {
073    
074                    return _webDAVStorage.getResources(webDAVRequest);
075            }
076    
077            @Override
078            public String getRootPath() {
079                    return _webDAVStorage.getRootPath();
080            }
081    
082            @Override
083            public String getToken() {
084                    return _webDAVStorage.getToken();
085            }
086    
087            public WebDAVStorage getWrappedWebDAVStorage() {
088                    return _webDAVStorage;
089            }
090    
091            @Override
092            public boolean isAvailable(WebDAVRequest webDAVRequest)
093                    throws WebDAVException {
094    
095                    return _webDAVStorage.isAvailable(webDAVRequest);
096            }
097    
098            @Override
099            public boolean isSupportsClassTwo() {
100                    return _webDAVStorage.isSupportsClassTwo();
101            }
102    
103            @Override
104            public Status lockResource(
105                            WebDAVRequest webDAVRequest, String owner, long timeout)
106                    throws WebDAVException {
107    
108                    return _webDAVStorage.lockResource(webDAVRequest, owner, timeout);
109            }
110    
111            @Override
112            public Status makeCollection(WebDAVRequest webDAVRequest)
113                    throws WebDAVException {
114    
115                    return _webDAVStorage.makeCollection(webDAVRequest);
116            }
117    
118            @Override
119            public int moveCollectionResource(
120                            WebDAVRequest webDAVRequest, Resource resource, String destination,
121                            boolean overwrite)
122                    throws WebDAVException {
123    
124                    return _webDAVStorage.moveCollectionResource(
125                            webDAVRequest, resource, destination, overwrite);
126            }
127    
128            @Override
129            public int moveSimpleResource(
130                            WebDAVRequest webDAVRequest, Resource resource, String destination,
131                            boolean overwrite)
132                    throws WebDAVException {
133    
134                    return _webDAVStorage.moveSimpleResource(
135                            webDAVRequest, resource, destination, overwrite);
136            }
137    
138            @Override
139            public int putResource(WebDAVRequest webDAVRequest) throws WebDAVException {
140                    return _webDAVStorage.putResource(webDAVRequest);
141            }
142    
143            @Override
144            public Lock refreshResourceLock(
145                            WebDAVRequest webDAVRequest, String uuid, long timeout)
146                    throws WebDAVException {
147    
148                    return _webDAVStorage.refreshResourceLock(webDAVRequest, uuid, timeout);
149            }
150    
151            @Override
152            public void setRootPath(String rootPath) {
153                    _webDAVStorage.setRootPath(rootPath);
154            }
155    
156            @Override
157            public void setToken(String token) {
158                    _webDAVStorage.setToken(token);
159            }
160    
161            @Override
162            public boolean unlockResource(WebDAVRequest webDAVRequest, String token)
163                    throws WebDAVException {
164    
165                    return _webDAVStorage.unlockResource(webDAVRequest, token);
166            }
167    
168            private WebDAVStorage _webDAVStorage;
169    
170    }