001    /**
002     * Copyright (c) 2000-2011 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            public void addDirectory(long companyId, long repositoryId, String dirName)
034                    throws PortalException, SystemException {
035    
036                    _store.addDirectory(companyId, repositoryId, dirName);
037            }
038    
039            public void addFile(
040                            long companyId, long repositoryId, String fileName, byte[] bytes)
041                    throws PortalException, SystemException {
042    
043                    _store.addFile(
044                            companyId, repositoryId, fileName, bytes);
045            }
046    
047            public void addFile(
048                            long companyId, long repositoryId, String fileName, File file)
049                    throws PortalException, SystemException {
050    
051                    _store.addFile(companyId, repositoryId, fileName, file);
052            }
053    
054            public void addFile(
055                            long companyId, long repositoryId, String fileName, InputStream is)
056                    throws PortalException, SystemException {
057    
058                    _store.addFile(companyId, repositoryId, fileName, is);
059            }
060    
061            public void checkRoot(long companyId) throws SystemException {
062                    _store.checkRoot(companyId);
063            }
064    
065            public void deleteDirectory(
066                            long companyId, long repositoryId, String dirName)
067                    throws PortalException, SystemException {
068    
069                    _store.deleteDirectory(companyId, repositoryId, dirName);
070            }
071    
072            public void copyFileVersion(
073                            long companyId, long repositoryId, String fileName,
074                            String fromVersionLabel, String toVersionLabel)
075                    throws PortalException, SystemException {
076    
077                    _store.copyFileVersion(
078                            companyId, repositoryId, fileName, fromVersionLabel,
079                            toVersionLabel);
080            }
081    
082            public void deleteFile(long companyId, long repositoryId, String fileName)
083                    throws PortalException, SystemException {
084    
085                    _store.deleteFile(companyId, repositoryId, fileName);
086            }
087    
088            public void deleteFile(
089                            long companyId, long repositoryId, String fileName,
090                            String versionLabel)
091                    throws PortalException, SystemException {
092    
093                    _store.deleteFile(companyId, repositoryId, fileName, versionLabel);
094            }
095    
096            public File getFile(long companyId, long repositoryId, String fileName)
097                    throws PortalException, SystemException {
098    
099                    return _store.getFile(companyId, repositoryId, fileName);
100            }
101    
102            public File getFile(
103                            long companyId, long repositoryId, String fileName,
104                            String versionLabel)
105                    throws PortalException, SystemException {
106    
107                    return _store.getFile(companyId, repositoryId, fileName, versionLabel);
108            }
109    
110            public byte[] getFileAsBytes(
111                            long companyId, long repositoryId, String fileName)
112                    throws PortalException, SystemException {
113    
114                    return _store.getFileAsBytes(companyId, repositoryId, fileName);
115            }
116    
117            public byte[] getFileAsBytes(
118                            long companyId, long repositoryId, String fileName,
119                            String versionLabel)
120                    throws PortalException, SystemException {
121    
122                    return _store.getFileAsBytes(
123                            companyId, repositoryId, fileName, versionLabel);
124            }
125    
126            public InputStream getFileAsStream(
127                            long companyId, long repositoryId, String fileName)
128                    throws PortalException, SystemException {
129    
130                    return _store.getFileAsStream(companyId, repositoryId, fileName);
131            }
132    
133            public InputStream getFileAsStream(
134                            long companyId, long repositoryId, String fileName,
135                            String versionLabel)
136                    throws PortalException, SystemException {
137    
138                    return _store.getFileAsStream(
139                            companyId, repositoryId, fileName, versionLabel);
140            }
141    
142            public String[] getFileNames(long companyId, long repositoryId)
143                    throws SystemException {
144    
145                    return _store.getFileNames(companyId, repositoryId);
146            }
147    
148            public String[] getFileNames(
149                            long companyId, long repositoryId, String dirName)
150                    throws PortalException, SystemException {
151    
152                    return _store.getFileNames(companyId, repositoryId, dirName);
153            }
154    
155            public long getFileSize(
156                            long companyId, long repositoryId, String fileName)
157                    throws PortalException, SystemException {
158    
159                    return _store.getFileSize(companyId, repositoryId, fileName);
160            }
161    
162            public boolean hasDirectory(
163                            long companyId, long repositoryId, String dirName)
164                    throws PortalException, SystemException {
165    
166                    return _store.hasDirectory(companyId, repositoryId, dirName);
167            }
168    
169            public boolean hasFile(long companyId, long repositoryId, String fileName)
170                    throws PortalException, SystemException {
171    
172                    return _store.hasFile(companyId, repositoryId, fileName);
173            }
174    
175            public boolean hasFile(
176                            long companyId, long repositoryId, String fileName,
177                            String versionLabel)
178                    throws PortalException, SystemException {
179    
180                    return _store.hasFile(companyId, repositoryId, fileName, versionLabel);
181            }
182    
183            public void move(String srcDir, String destDir) throws SystemException {
184                    _store.move(srcDir, destDir);
185            }
186    
187            public void updateFile(
188                            long companyId, long repositoryId, long newRepositoryId,
189                            String fileName)
190                    throws PortalException, SystemException {
191    
192                    _store.updateFile(companyId, repositoryId, newRepositoryId, fileName);
193            }
194    
195            public void updateFile(
196                            long companyId, long repositoryId, String fileName,
197                            String newFileName)
198                    throws PortalException, SystemException {
199    
200                    _store.updateFile(companyId, repositoryId, fileName, newFileName);
201            }
202    
203            public void updateFile(
204                            long companyId, long repositoryId, String fileName,
205                            String versionLabel, byte[] bytes)
206                    throws PortalException, SystemException {
207    
208                    _store.updateFile(
209                            companyId, repositoryId, fileName, versionLabel, bytes);
210            }
211    
212            public void updateFile(
213                            long companyId, long repositoryId, String fileName,
214                            String versionLabel, File file)
215                    throws PortalException, SystemException {
216    
217                    _store.updateFile(
218                            companyId, repositoryId, fileName, versionLabel, file);
219            }
220    
221            public void updateFile(
222                            long companyId, long repositoryId, String fileName,
223                            String versionLabel, InputStream is)
224                    throws PortalException, SystemException {
225    
226                    _store.updateFile(companyId, repositoryId, fileName, versionLabel, is);
227            }
228    
229            public void updateFileVersion(
230                            long companyId, long repositoryId, String fileName,
231                            String fromVersionLabel, String toVersionLabel)
232                    throws PortalException, SystemException {
233    
234                    _store.updateFileVersion(
235                            companyId, repositoryId, fileName, fromVersionLabel,
236                            toVersionLabel);
237            }
238    
239            private Store _store;
240    
241    }