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 newFileName, boolean reindex)
178         throws PortalException, SystemException {
179 
180         _hook.updateFile(
181             companyId, portletId, groupId, repositoryId, fileName,
182             newFileName, reindex);
183     }
184 
185     public void updateFile(
186             long companyId, String portletId, long groupId, long repositoryId,
187             String fileName, String versionNumber, String sourceFileName,
188             long fileEntryId, String properties, Date modifiedDate,
189             ServiceContext serviceContext, byte[] bytes)
190         throws PortalException, SystemException {
191 
192         _hook.updateFile(
193             companyId, portletId, groupId, repositoryId, fileName,
194             versionNumber, sourceFileName, fileEntryId, properties,
195             modifiedDate, serviceContext, bytes);
196     }
197 
198     public void updateFile(
199             long companyId, String portletId, long groupId, long repositoryId,
200             String fileName, String versionNumber, String sourceFileName,
201             long fileEntryId, String properties, Date modifiedDate,
202             ServiceContext serviceContext, File file)
203         throws PortalException, SystemException {
204 
205         _hook.updateFile(
206             companyId, portletId, groupId, repositoryId, fileName,
207             versionNumber, sourceFileName, fileEntryId, properties,
208             modifiedDate, serviceContext, file);
209     }
210 
211     public void updateFile(
212             long companyId, String portletId, long groupId, long repositoryId,
213             String fileName, String versionNumber, String sourceFileName,
214             long fileEntryId, String properties, Date modifiedDate,
215             ServiceContext serviceContext, InputStream is)
216         throws PortalException, SystemException {
217 
218         _hook.updateFile(
219             companyId, portletId, groupId, repositoryId, fileName,
220             versionNumber, sourceFileName, fileEntryId, properties,
221             modifiedDate, serviceContext, is);
222     }
223 
224     private Hook _hook;
225 
226 }