1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.documentlibrary.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="DLFileEntryServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link DLFileEntryService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       DLFileEntryService
39   * @generated
40   */
41  public class DLFileEntryServiceUtil {
42      /**
43      * @deprecated
44      */
45      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
46          long folderId, java.lang.String name, java.lang.String title,
47          java.lang.String description, java.lang.String extraSettings,
48          byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
49          throws com.liferay.portal.PortalException,
50              com.liferay.portal.SystemException {
51          return getService()
52                     .addFileEntry(folderId, name, title, description,
53              extraSettings, bytes, serviceContext);
54      }
55  
56      /**
57      * @deprecated
58      */
59      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
60          long folderId, java.lang.String name, java.lang.String title,
61          java.lang.String description, java.lang.String extraSettings,
62          java.io.File file,
63          com.liferay.portal.service.ServiceContext serviceContext)
64          throws com.liferay.portal.PortalException,
65              com.liferay.portal.SystemException {
66          return getService()
67                     .addFileEntry(folderId, name, title, description,
68              extraSettings, file, serviceContext);
69      }
70  
71      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
72          long folderId, java.lang.String name, java.lang.String title,
73          java.lang.String description, java.lang.String versionDescription,
74          java.lang.String extraSettings, byte[] bytes,
75          com.liferay.portal.service.ServiceContext serviceContext)
76          throws com.liferay.portal.PortalException,
77              com.liferay.portal.SystemException {
78          return getService()
79                     .addFileEntry(folderId, name, title, description,
80              versionDescription, extraSettings, bytes, serviceContext);
81      }
82  
83      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
84          long folderId, java.lang.String name, java.lang.String title,
85          java.lang.String description, java.lang.String versionDescription,
86          java.lang.String extraSettings, java.io.File file,
87          com.liferay.portal.service.ServiceContext serviceContext)
88          throws com.liferay.portal.PortalException,
89              com.liferay.portal.SystemException {
90          return getService()
91                     .addFileEntry(folderId, name, title, description,
92              versionDescription, extraSettings, file, serviceContext);
93      }
94  
95      public static void deleteFileEntry(long folderId, java.lang.String name)
96          throws com.liferay.portal.PortalException,
97              com.liferay.portal.SystemException {
98          getService().deleteFileEntry(folderId, name);
99      }
100 
101     public static void deleteFileEntry(long folderId, java.lang.String name,
102         double version)
103         throws com.liferay.portal.PortalException,
104             com.liferay.portal.SystemException {
105         getService().deleteFileEntry(folderId, name, version);
106     }
107 
108     public static void deleteFileEntryByTitle(long folderId,
109         java.lang.String titleWithExtension)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         getService().deleteFileEntryByTitle(folderId, titleWithExtension);
113     }
114 
115     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
116         long folderId)
117         throws com.liferay.portal.PortalException,
118             com.liferay.portal.SystemException {
119         return getService().getFileEntries(folderId);
120     }
121 
122     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
123         long folderId, java.lang.String name)
124         throws com.liferay.portal.PortalException,
125             com.liferay.portal.SystemException {
126         return getService().getFileEntry(folderId, name);
127     }
128 
129     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
130         long folderId, java.lang.String titleWithExtension)
131         throws com.liferay.portal.PortalException,
132             com.liferay.portal.SystemException {
133         return getService().getFileEntryByTitle(folderId, titleWithExtension);
134     }
135 
136     public static com.liferay.portal.model.Lock getFileEntryLock(
137         long folderId, java.lang.String name)
138         throws com.liferay.portal.PortalException,
139             com.liferay.portal.SystemException {
140         return getService().getFileEntryLock(folderId, name);
141     }
142 
143     public static boolean hasFileEntryLock(long folderId, java.lang.String name)
144         throws com.liferay.portal.PortalException,
145             com.liferay.portal.SystemException {
146         return getService().hasFileEntryLock(folderId, name);
147     }
148 
149     public static com.liferay.portal.model.Lock lockFileEntry(long folderId,
150         java.lang.String name)
151         throws com.liferay.portal.PortalException,
152             com.liferay.portal.SystemException {
153         return getService().lockFileEntry(folderId, name);
154     }
155 
156     public static com.liferay.portal.model.Lock lockFileEntry(long folderId,
157         java.lang.String name, java.lang.String owner, long expirationTime)
158         throws com.liferay.portal.PortalException,
159             com.liferay.portal.SystemException {
160         return getService().lockFileEntry(folderId, name, owner, expirationTime);
161     }
162 
163     public static com.liferay.portal.model.Lock refreshFileEntryLock(
164         java.lang.String lockUuid, long expirationTime)
165         throws com.liferay.portal.PortalException,
166             com.liferay.portal.SystemException {
167         return getService().refreshFileEntryLock(lockUuid, expirationTime);
168     }
169 
170     public static void unlockFileEntry(long folderId, java.lang.String name)
171         throws com.liferay.portal.SystemException {
172         getService().unlockFileEntry(folderId, name);
173     }
174 
175     public static void unlockFileEntry(long folderId, java.lang.String name,
176         java.lang.String lockUuid)
177         throws com.liferay.portal.PortalException,
178             com.liferay.portal.SystemException {
179         getService().unlockFileEntry(folderId, name, lockUuid);
180     }
181 
182     /**
183     * @deprecated
184     */
185     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
186         long folderId, long newFolderId, java.lang.String name,
187         java.lang.String sourceFileName, java.lang.String title,
188         java.lang.String description, java.lang.String extraSettings,
189         byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
190         throws com.liferay.portal.PortalException,
191             com.liferay.portal.SystemException {
192         return getService()
193                    .updateFileEntry(folderId, newFolderId, name,
194             sourceFileName, title, description, extraSettings, bytes,
195             serviceContext);
196     }
197 
198     /**
199     * @deprecated
200     */
201     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
202         long folderId, long newFolderId, java.lang.String name,
203         java.lang.String sourceFileName, java.lang.String title,
204         java.lang.String description, java.lang.String extraSettings,
205         java.io.File file,
206         com.liferay.portal.service.ServiceContext serviceContext)
207         throws com.liferay.portal.PortalException,
208             com.liferay.portal.SystemException {
209         return getService()
210                    .updateFileEntry(folderId, newFolderId, name,
211             sourceFileName, title, description, extraSettings, file,
212             serviceContext);
213     }
214 
215     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
216         long folderId, long newFolderId, java.lang.String name,
217         java.lang.String sourceFileName, java.lang.String title,
218         java.lang.String description, java.lang.String versionDescription,
219         java.lang.String extraSettings, byte[] bytes,
220         com.liferay.portal.service.ServiceContext serviceContext)
221         throws com.liferay.portal.PortalException,
222             com.liferay.portal.SystemException {
223         return getService()
224                    .updateFileEntry(folderId, newFolderId, name,
225             sourceFileName, title, description, versionDescription,
226             extraSettings, bytes, serviceContext);
227     }
228 
229     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
230         long folderId, long newFolderId, java.lang.String name,
231         java.lang.String sourceFileName, java.lang.String title,
232         java.lang.String description, java.lang.String versionDescription,
233         java.lang.String extraSettings, java.io.File file,
234         com.liferay.portal.service.ServiceContext serviceContext)
235         throws com.liferay.portal.PortalException,
236             com.liferay.portal.SystemException {
237         return getService()
238                    .updateFileEntry(folderId, newFolderId, name,
239             sourceFileName, title, description, versionDescription,
240             extraSettings, file, serviceContext);
241     }
242 
243     public static boolean verifyFileEntryLock(long folderId,
244         java.lang.String name, java.lang.String lockUuid)
245         throws com.liferay.portal.PortalException,
246             com.liferay.portal.SystemException {
247         return getService().verifyFileEntryLock(folderId, name, lockUuid);
248     }
249 
250     public static DLFileEntryService getService() {
251         if (_service == null) {
252             _service = (DLFileEntryService)PortalBeanLocatorUtil.locate(DLFileEntryService.class.getName());
253 
254             ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
255                 "_service");
256             MethodCache.remove(DLFileEntryService.class);
257         }
258 
259         return _service;
260     }
261 
262     public void setService(DLFileEntryService service) {
263         MethodCache.remove(DLFileEntryService.class);
264 
265         _service = service;
266 
267         ReferenceRegistry.registerReference(DLFileEntryServiceUtil.class,
268             "_service");
269         MethodCache.remove(DLFileEntryService.class);
270     }
271 
272     private static DLFileEntryService _service;
273 }