1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.documentlibrary.util;
16  
17  import com.liferay.portal.kernel.exception.PortalException;
18  import com.liferay.portal.kernel.exception.SystemException;
19  import com.liferay.portal.kernel.search.SearchException;
20  import com.liferay.portal.service.ServiceContext;
21  
22  import java.io.File;
23  import java.io.InputStream;
24  
25  import java.util.Date;
26  
27  /**
28   * <a href="HookWrapper.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Brian Wing Shun Chan
31   */
32  public class HookWrapper implements Hook {
33  
34      public HookWrapper(Hook hook) {
35          _hook = hook;
36      }
37  
38      public void addDirectory(long companyId, long repositoryId, String dirName)
39          throws PortalException, SystemException {
40  
41          _hook.addDirectory(companyId, repositoryId, dirName);
42      }
43  
44      public void addFile(
45              long companyId, String portletId, long groupId, long repositoryId,
46              String fileName, long fileEntryId, String properties,
47              Date modifiedDate, ServiceContext serviceContext, byte[] bytes)
48          throws PortalException, SystemException {
49  
50          _hook.addFile(
51              companyId, portletId, groupId, repositoryId, fileName, fileEntryId,
52              properties, modifiedDate, serviceContext, bytes);
53      }
54  
55      public void addFile(
56              long companyId, String portletId, long groupId, long repositoryId,
57              String fileName, long fileEntryId, String properties,
58              Date modifiedDate, ServiceContext serviceContext, File file)
59          throws PortalException, SystemException {
60  
61          _hook.addFile(
62              companyId, portletId, groupId, repositoryId, fileName, fileEntryId,
63              properties, modifiedDate, serviceContext, file);
64      }
65  
66      public void addFile(
67              long companyId, String portletId, long groupId, long repositoryId,
68              String fileName, long fileEntryId, String properties,
69              Date modifiedDate, ServiceContext serviceContext, InputStream is)
70          throws PortalException, SystemException {
71  
72          _hook.addFile(
73              companyId, portletId, groupId, repositoryId, fileName, fileEntryId,
74              properties, modifiedDate, serviceContext, is);
75      }
76  
77      public void checkRoot(long companyId) throws SystemException {
78          _hook.checkRoot(companyId);
79      }
80  
81      public void deleteDirectory(
82              long companyId, String portletId, long repositoryId, String dirName)
83          throws PortalException, SystemException {
84  
85          _hook.deleteDirectory(companyId, portletId, repositoryId, dirName);
86      }
87  
88      public void deleteFile(
89              long companyId, String portletId, long repositoryId,
90              String fileName)
91          throws PortalException, SystemException {
92  
93          _hook.deleteFile(companyId, portletId, repositoryId, fileName);
94      }
95  
96      public void deleteFile(
97              long companyId, String portletId, long repositoryId,
98              String fileName, String versionNumber)
99          throws PortalException, SystemException {
100 
101         _hook.deleteFile(
102             companyId, portletId, repositoryId, fileName, versionNumber);
103     }
104 
105     public byte[] getFile(long companyId, long repositoryId, String fileName)
106         throws PortalException, SystemException {
107 
108         return _hook.getFile(companyId, repositoryId, fileName);
109     }
110 
111     public byte[] getFile(
112             long companyId, long repositoryId, String fileName,
113             String versionNumber)
114         throws PortalException, SystemException {
115 
116         return _hook.getFile(companyId, repositoryId, fileName, versionNumber);
117     }
118 
119     public InputStream getFileAsStream(
120             long companyId, long repositoryId, String fileName)
121         throws PortalException, SystemException {
122 
123         return _hook.getFileAsStream(companyId, repositoryId, fileName);
124     }
125 
126     public InputStream getFileAsStream(
127             long companyId, long repositoryId, String fileName,
128             String versionNumber)
129         throws PortalException, SystemException {
130 
131         return _hook.getFileAsStream(
132             companyId, repositoryId, fileName, versionNumber);
133     }
134 
135     public String[] getFileNames(
136             long companyId, long repositoryId, String dirName)
137         throws PortalException, SystemException {
138 
139         return _hook.getFileNames(companyId, repositoryId, dirName);
140     }
141 
142     public long getFileSize(
143             long companyId, long repositoryId, String fileName)
144         throws PortalException, SystemException {
145 
146         return _hook.getFileSize(companyId, repositoryId, fileName);
147     }
148 
149     public boolean hasFile(
150             long companyId, long repositoryId, String fileName,
151             String versionNumber)
152         throws PortalException, SystemException {
153 
154         return _hook.hasFile(companyId, repositoryId, fileName, versionNumber);
155     }
156 
157     public void move(String srcDir, String destDir) throws SystemException {
158         _hook.move(srcDir, destDir);
159     }
160 
161     public void reindex(String[] ids) throws SearchException {
162         _hook.reindex(ids);
163     }
164 
165     public void updateFile(
166             long companyId, String portletId, long groupId, long repositoryId,
167             long newRepositoryId, String fileName, long fileEntryId)
168         throws PortalException, SystemException {
169 
170         _hook.updateFile(
171             companyId, portletId, groupId, repositoryId, newRepositoryId,
172             fileName, fileEntryId);
173     }
174 
175     public void updateFile(
176             long companyId, String portletId, long groupId, long repositoryId,
177             String fileName, String versionNumber, String sourceFileName,
178             long fileEntryId, String properties, Date modifiedDate,
179             ServiceContext serviceContext, byte[] bytes)
180         throws PortalException, SystemException {
181 
182         _hook.updateFile(
183             companyId, portletId, groupId, repositoryId, fileName,
184             versionNumber, sourceFileName, fileEntryId, properties,
185             modifiedDate, serviceContext, bytes);
186     }
187 
188     public void updateFile(
189             long companyId, String portletId, long groupId, long repositoryId,
190             String fileName, String versionNumber, String sourceFileName,
191             long fileEntryId, String properties, Date modifiedDate,
192             ServiceContext serviceContext, File file)
193         throws PortalException, SystemException {
194 
195         _hook.updateFile(
196             companyId, portletId, groupId, repositoryId, fileName,
197             versionNumber, sourceFileName, fileEntryId, properties,
198             modifiedDate, serviceContext, file);
199     }
200 
201     public void updateFile(
202             long companyId, String portletId, long groupId, long repositoryId,
203             String fileName, String versionNumber, String sourceFileName,
204             long fileEntryId, String properties, Date modifiedDate,
205             ServiceContext serviceContext, InputStream is)
206         throws PortalException, SystemException {
207 
208         _hook.updateFile(
209             companyId, portletId, groupId, repositoryId, fileName,
210             versionNumber, sourceFileName, fileEntryId, properties,
211             modifiedDate, serviceContext, is);
212     }
213 
214     public void updateFile(
215             long companyId, String portletId, long groupId, long repositoryId,
216             String fileName, String newFileName, boolean reindex)
217         throws PortalException, SystemException {
218 
219         _hook.updateFile(
220             companyId, portletId, groupId, repositoryId, fileName,
221             newFileName, reindex);
222     }
223 
224     private Hook _hook;
225 
226 }