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