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.portal.repository.proxy;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.repository.model.FileEntry;
020    import com.liferay.portal.kernel.repository.model.FileVersion;
021    import com.liferay.portal.kernel.repository.model.Folder;
022    import com.liferay.portal.model.Lock;
023    import com.liferay.portal.security.permission.PermissionChecker;
024    import com.liferay.portlet.expando.model.ExpandoBridge;
025    
026    import java.io.InputStream;
027    import java.io.Serializable;
028    
029    import java.util.Date;
030    import java.util.List;
031    import java.util.Map;
032    
033    /**
034     * @author Mika Koivisto
035     */
036    public class FileEntryProxyBean
037            extends RepositoryModelProxyBean implements FileEntry {
038    
039            public FileEntryProxyBean(FileEntry fileEntry, ClassLoader classLoader) {
040                    super(classLoader);
041    
042                    _fileEntry = fileEntry;
043            }
044    
045            public boolean containsPermission(
046                            PermissionChecker permissionChecker, String actionId)
047                    throws PortalException, SystemException {
048    
049                    return _fileEntry.containsPermission(permissionChecker, actionId);
050            }
051    
052            public Map<String, Serializable> getAttributes() {
053                    return _fileEntry.getAttributes();
054            }
055    
056            public long getCompanyId() {
057                    return _fileEntry.getCompanyId();
058            }
059    
060            public InputStream getContentStream()
061                    throws PortalException, SystemException {
062    
063                    return _fileEntry.getContentStream();
064            }
065    
066            public InputStream getContentStream(String version)
067                    throws PortalException, SystemException {
068    
069                    return _fileEntry.getContentStream(version);
070            }
071    
072            public Date getCreateDate() {
073                    return _fileEntry.getCreateDate();
074            }
075    
076            public long getCustom1ImageId() {
077                    return _fileEntry.getCustom1ImageId();
078            }
079    
080            public long getCustom2ImageId() {
081                    return _fileEntry.getCustom2ImageId();
082            }
083    
084            public String getDescription() {
085                    return _fileEntry.getDescription();
086            }
087    
088            public ExpandoBridge getExpandoBridge() {
089                    ExpandoBridge expandoBridge = _fileEntry.getExpandoBridge();
090    
091                    return (ExpandoBridge)newProxyInstance(
092                            expandoBridge, ExpandoBridge.class);
093            }
094    
095            public String getExtension() {
096                    return _fileEntry.getExtension();
097            }
098    
099            public long getFileEntryId() {
100                    return _fileEntry.getFileEntryId();
101            }
102    
103            public FileVersion getFileVersion()
104                    throws PortalException, SystemException {
105    
106                    FileVersion fileVersion = _fileEntry.getFileVersion();
107    
108                    return newFileVersionProxyBean(fileVersion);
109            }
110    
111            public FileVersion getFileVersion(String version)
112                    throws PortalException, SystemException {
113    
114                    FileVersion fileVersion = _fileEntry.getFileVersion(version);
115    
116                    return newFileVersionProxyBean(fileVersion);
117            }
118    
119            public List<FileVersion> getFileVersions(int status)
120                    throws SystemException {
121    
122                    List<FileVersion> fileVersions = _fileEntry.getFileVersions(status);
123    
124                    return toFileVersionProxyBeans(fileVersions);
125            }
126    
127            public Folder getFolder() {
128                    Folder folder = _fileEntry.getFolder();
129    
130                    return newFolderProxyBean(folder);
131            }
132    
133            public long getFolderId() {
134                    return _fileEntry.getFolderId();
135            }
136    
137            public long getGroupId() {
138                    return _fileEntry.getGroupId();
139            }
140    
141            public String getIcon() {
142                    return _fileEntry.getIcon();
143            }
144    
145            public String getImageType() {
146                    return _fileEntry.getImageType();
147            }
148    
149            public long getLargeImageId() {
150                    return _fileEntry.getLargeImageId();
151            }
152    
153            public FileVersion getLatestFileVersion()
154                    throws PortalException, SystemException {
155    
156                    FileVersion fileVersion = _fileEntry.getLatestFileVersion();
157    
158                    return newFileVersionProxyBean(fileVersion);
159            }
160    
161            public Lock getLock() {
162                    Lock lock = _fileEntry.getLock();
163    
164                    return (Lock)newProxyInstance(lock, Lock.class);
165            }
166    
167            public String getMimeType() {
168                    return _fileEntry.getMimeType();
169            }
170    
171            public String getMimeType(String version) {
172                    return _fileEntry.getMimeType(version);
173            }
174    
175            public Object getModel() {
176                    return _fileEntry.getModel();
177            }
178    
179            public Class<?> getModelClass() {
180                    return _fileEntry.getModelClass();
181            }
182    
183            public String getModelClassName() {
184                    return _fileEntry.getModelClassName();
185            }
186    
187            public Date getModifiedDate() {
188                    return _fileEntry.getModifiedDate();
189            }
190    
191            public String getNameWithExtension() {
192                    return _fileEntry.getNameWithExtension();
193            }
194    
195            public long getPrimaryKey() {
196                    return _fileEntry.getPrimaryKey();
197            }
198    
199            public Serializable getPrimaryKeyObj() {
200                    return _fileEntry.getPrimaryKeyObj();
201            }
202    
203            public int getReadCount() {
204                    return _fileEntry.getReadCount();
205            }
206    
207            public long getRepositoryId() {
208                    return _fileEntry.getRepositoryId();
209            }
210    
211            public long getSize() {
212                    return _fileEntry.getSize();
213            }
214    
215            public long getSmallImageId() {
216                    return _fileEntry.getSmallImageId();
217            }
218    
219            public String getTitle() {
220                    return _fileEntry.getTitle();
221            }
222    
223            public long getUserId() {
224                    return _fileEntry.getUserId();
225            }
226    
227            public String getUserName() {
228                    return _fileEntry.getUserName();
229            }
230    
231            public String getUserUuid() throws SystemException {
232                    return _fileEntry.getUserUuid();
233            }
234    
235            public String getUuid() {
236                    return _fileEntry.getUuid();
237            }
238    
239            public String getVersion() {
240                    return _fileEntry.getVersion();
241            }
242    
243            public long getVersionUserId() {
244                    return _fileEntry.getVersionUserId();
245            }
246    
247            public String getVersionUserName() {
248                    return _fileEntry.getVersionUserName();
249            }
250    
251            public String getVersionUserUuid() throws SystemException {
252                    return _fileEntry.getVersionUserUuid();
253            }
254    
255            public boolean hasLock() {
256                    return _fileEntry.hasLock();
257            }
258    
259            public boolean isCheckedOut() {
260                    return _fileEntry.isCheckedOut();
261            }
262    
263            public boolean isDefaultRepository() {
264                    return _fileEntry.isDefaultRepository();
265            }
266    
267            public boolean isEscapedModel() {
268                    return _fileEntry.isEscapedModel();
269            }
270    
271            public boolean isSupportsLocking() {
272                    return _fileEntry.isSupportsLocking();
273            }
274    
275            public boolean isSupportsMetadata() {
276                    return _fileEntry.isSupportsMetadata();
277            }
278    
279            public boolean isSupportsSocial() {
280                    return _fileEntry.isSupportsSocial();
281            }
282    
283            public void setCompanyId(long companyId) {
284                    _fileEntry.setCompanyId(companyId);
285            }
286    
287            public void setCreateDate(Date date) {
288                    _fileEntry.setCreateDate(date);
289            }
290    
291            public void setGroupId(long groupId) {
292                    _fileEntry.setGroupId(groupId);
293            }
294    
295            public void setModifiedDate(Date date) {
296                    _fileEntry.setModifiedDate(date);
297            }
298    
299            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
300                    _fileEntry.setPrimaryKeyObj(primaryKeyObj);
301            }
302    
303            public void setUserId(long userId) {
304                    _fileEntry.setUserId(userId);
305            }
306    
307            public void setUserName(String userName) {
308                    _fileEntry.setUserName(userName);
309            }
310    
311            public void setUserUuid(String userUuid) {
312                    _fileEntry.setUserUuid(userUuid);
313            }
314    
315            public FileEntry toEscapedModel() {
316                    FileEntry fileEntry = _fileEntry.toEscapedModel();
317    
318                    return newFileEntryProxyBean(fileEntry);
319            }
320    
321            private FileEntry _fileEntry;
322    
323    }