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.portlet.documentlibrary.store;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    
020    import java.io.File;
021    import java.io.InputStream;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     * @author Edward Han
026     */
027    public class StoreWrapper implements Store {
028    
029            public StoreWrapper(Store store) {
030                    _store = store;
031            }
032    
033            @Override
034            public void addDirectory(long companyId, long repositoryId, String dirName)
035                    throws PortalException, SystemException {
036    
037                    _store.addDirectory(companyId, repositoryId, dirName);
038            }
039    
040            @Override
041            public void addFile(
042                            long companyId, long repositoryId, String fileName, byte[] bytes)
043                    throws PortalException, SystemException {
044    
045                    _store.addFile(companyId, repositoryId, fileName, bytes);
046            }
047    
048            @Override
049            public void addFile(
050                            long companyId, long repositoryId, String fileName, File file)
051                    throws PortalException, SystemException {
052    
053                    _store.addFile(companyId, repositoryId, fileName, file);
054            }
055    
056            @Override
057            public void addFile(
058                            long companyId, long repositoryId, String fileName, InputStream is)
059                    throws PortalException, SystemException {
060    
061                    _store.addFile(companyId, repositoryId, fileName, is);
062            }
063    
064            @Override
065            public void checkRoot(long companyId) throws SystemException {
066                    _store.checkRoot(companyId);
067            }
068    
069            @Override
070            public void copyFileVersion(
071                            long companyId, long repositoryId, String fileName,
072                            String fromVersionLabel, String toVersionLabel)
073                    throws PortalException, SystemException {
074    
075                    _store.copyFileVersion(
076                            companyId, repositoryId, fileName, fromVersionLabel,
077                            toVersionLabel);
078            }
079    
080            @Override
081            public void deleteDirectory(
082                            long companyId, long repositoryId, String dirName)
083                    throws PortalException, SystemException {
084    
085                    _store.deleteDirectory(companyId, repositoryId, dirName);
086            }
087    
088            @Override
089            public void deleteFile(long companyId, long repositoryId, String fileName)
090                    throws PortalException, SystemException {
091    
092                    _store.deleteFile(companyId, repositoryId, fileName);
093            }
094    
095            @Override
096            public void deleteFile(
097                            long companyId, long repositoryId, String fileName,
098                            String versionLabel)
099                    throws PortalException, SystemException {
100    
101                    _store.deleteFile(companyId, repositoryId, fileName, versionLabel);
102            }
103    
104            @Override
105            public File getFile(long companyId, long repositoryId, String fileName)
106                    throws PortalException, SystemException {
107    
108                    return _store.getFile(companyId, repositoryId, fileName);
109            }
110    
111            @Override
112            public File getFile(
113                            long companyId, long repositoryId, String fileName,
114                            String versionLabel)
115                    throws PortalException, SystemException {
116    
117                    return _store.getFile(companyId, repositoryId, fileName, versionLabel);
118            }
119    
120            @Override
121            public byte[] getFileAsBytes(
122                            long companyId, long repositoryId, String fileName)
123                    throws PortalException, SystemException {
124    
125                    return _store.getFileAsBytes(companyId, repositoryId, fileName);
126            }
127    
128            @Override
129            public byte[] getFileAsBytes(
130                            long companyId, long repositoryId, String fileName,
131                            String versionLabel)
132                    throws PortalException, SystemException {
133    
134                    return _store.getFileAsBytes(
135                            companyId, repositoryId, fileName, versionLabel);
136            }
137    
138            @Override
139            public InputStream getFileAsStream(
140                            long companyId, long repositoryId, String fileName)
141                    throws PortalException, SystemException {
142    
143                    return _store.getFileAsStream(companyId, repositoryId, fileName);
144            }
145    
146            @Override
147            public InputStream getFileAsStream(
148                            long companyId, long repositoryId, String fileName,
149                            String versionLabel)
150                    throws PortalException, SystemException {
151    
152                    return _store.getFileAsStream(
153                            companyId, repositoryId, fileName, versionLabel);
154            }
155    
156            @Override
157            public String[] getFileNames(long companyId, long repositoryId)
158                    throws SystemException {
159    
160                    return _store.getFileNames(companyId, repositoryId);
161            }
162    
163            @Override
164            public String[] getFileNames(
165                            long companyId, long repositoryId, String dirName)
166                    throws PortalException, SystemException {
167    
168                    return _store.getFileNames(companyId, repositoryId, dirName);
169            }
170    
171            @Override
172            public long getFileSize(long companyId, long repositoryId, String fileName)
173                    throws PortalException, SystemException {
174    
175                    return _store.getFileSize(companyId, repositoryId, fileName);
176            }
177    
178            @Override
179            public boolean hasDirectory(
180                            long companyId, long repositoryId, String dirName)
181                    throws PortalException, SystemException {
182    
183                    return _store.hasDirectory(companyId, repositoryId, dirName);
184            }
185    
186            @Override
187            public boolean hasFile(long companyId, long repositoryId, String fileName)
188                    throws PortalException, SystemException {
189    
190                    return _store.hasFile(companyId, repositoryId, fileName);
191            }
192    
193            @Override
194            public boolean hasFile(
195                            long companyId, long repositoryId, String fileName,
196                            String versionLabel)
197                    throws PortalException, SystemException {
198    
199                    return _store.hasFile(companyId, repositoryId, fileName, versionLabel);
200            }
201    
202            @Override
203            public void move(String srcDir, String destDir) throws SystemException {
204                    _store.move(srcDir, destDir);
205            }
206    
207            @Override
208            public void updateFile(
209                            long companyId, long repositoryId, long newRepositoryId,
210                            String fileName)
211                    throws PortalException, SystemException {
212    
213                    _store.updateFile(companyId, repositoryId, newRepositoryId, fileName);
214            }
215    
216            @Override
217            public void updateFile(
218                            long companyId, long repositoryId, String fileName,
219                            String newFileName)
220                    throws PortalException, SystemException {
221    
222                    _store.updateFile(companyId, repositoryId, fileName, newFileName);
223            }
224    
225            @Override
226            public void updateFile(
227                            long companyId, long repositoryId, String fileName,
228                            String versionLabel, byte[] bytes)
229                    throws PortalException, SystemException {
230    
231                    _store.updateFile(
232                            companyId, repositoryId, fileName, versionLabel, bytes);
233            }
234    
235            @Override
236            public void updateFile(
237                            long companyId, long repositoryId, String fileName,
238                            String versionLabel, File file)
239                    throws PortalException, SystemException {
240    
241                    _store.updateFile(
242                            companyId, repositoryId, fileName, versionLabel, file);
243            }
244    
245            @Override
246            public void updateFile(
247                            long companyId, long repositoryId, String fileName,
248                            String versionLabel, InputStream is)
249                    throws PortalException, SystemException {
250    
251                    _store.updateFile(companyId, repositoryId, fileName, versionLabel, is);
252            }
253    
254            @Override
255            public void updateFileVersion(
256                            long companyId, long repositoryId, String fileName,
257                            String fromVersionLabel, String toVersionLabel)
258                    throws PortalException, SystemException {
259    
260                    _store.updateFileVersion(
261                            companyId, repositoryId, fileName, fromVersionLabel,
262                            toVersionLabel);
263            }
264    
265            private Store _store;
266    
267    }