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