1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.documentlibrary.service;
24  
25  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
26  
27  /**
28   * <a href="DLFileEntryServiceUtil.java.html"><b><i>View Source</i></b></a>
29   *
30   * <p>
31   * ServiceBuilder generated this class. Modifications in this class will be
32   * overwritten the next time is generated.
33   * </p>
34   *
35   * <p>
36   * This class provides static methods for the
37   * {@link DLFileEntryService} bean. The static methods of
38   * this class calls the same methods of the bean instance. It's convenient to be
39   * able to just write one line to call a method on a bean instead of writing a
40   * lookup call and a method call.
41   * </p>
42   *
43   * @author    Brian Wing Shun Chan
44   * @see       DLFileEntryService
45   * @generated
46   */
47  public class DLFileEntryServiceUtil {
48      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
49          long folderId, java.lang.String name, java.lang.String title,
50          java.lang.String description, java.lang.String extraSettings,
51          byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
52          throws com.liferay.portal.PortalException,
53              com.liferay.portal.SystemException {
54          return getService()
55                     .addFileEntry(folderId, name, title, description,
56              extraSettings, bytes, serviceContext);
57      }
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 void deleteFileEntry(long folderId, java.lang.String name)
72          throws com.liferay.portal.PortalException,
73              com.liferay.portal.SystemException {
74          getService().deleteFileEntry(folderId, name);
75      }
76  
77      public static void deleteFileEntry(long folderId, java.lang.String name,
78          double version)
79          throws com.liferay.portal.PortalException,
80              com.liferay.portal.SystemException {
81          getService().deleteFileEntry(folderId, name, version);
82      }
83  
84      public static void deleteFileEntryByTitle(long folderId,
85          java.lang.String titleWithExtension)
86          throws com.liferay.portal.PortalException,
87              com.liferay.portal.SystemException {
88          getService().deleteFileEntryByTitle(folderId, titleWithExtension);
89      }
90  
91      public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
92          long folderId)
93          throws com.liferay.portal.PortalException,
94              com.liferay.portal.SystemException {
95          return getService().getFileEntries(folderId);
96      }
97  
98      public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
99          long folderId, java.lang.String name)
100         throws com.liferay.portal.PortalException,
101             com.liferay.portal.SystemException {
102         return getService().getFileEntry(folderId, name);
103     }
104 
105     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
106         long folderId, java.lang.String titleWithExtension)
107         throws com.liferay.portal.PortalException,
108             com.liferay.portal.SystemException {
109         return getService().getFileEntryByTitle(folderId, titleWithExtension);
110     }
111 
112     public static boolean hasFileEntryLock(long folderId, java.lang.String name)
113         throws com.liferay.portal.PortalException,
114             com.liferay.portal.SystemException {
115         return getService().hasFileEntryLock(folderId, name);
116     }
117 
118     public static com.liferay.portal.model.Lock lockFileEntry(long folderId,
119         java.lang.String name)
120         throws com.liferay.portal.PortalException,
121             com.liferay.portal.SystemException {
122         return getService().lockFileEntry(folderId, name);
123     }
124 
125     public static com.liferay.portal.model.Lock lockFileEntry(long folderId,
126         java.lang.String name, java.lang.String owner, long expirationTime)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException {
129         return getService().lockFileEntry(folderId, name, owner, expirationTime);
130     }
131 
132     public static com.liferay.portal.model.Lock refreshFileEntryLock(
133         java.lang.String lockUuid, long expirationTime)
134         throws com.liferay.portal.PortalException,
135             com.liferay.portal.SystemException {
136         return getService().refreshFileEntryLock(lockUuid, expirationTime);
137     }
138 
139     public static void unlockFileEntry(long folderId, java.lang.String name)
140         throws com.liferay.portal.SystemException {
141         getService().unlockFileEntry(folderId, name);
142     }
143 
144     public static void unlockFileEntry(long folderId, java.lang.String name,
145         java.lang.String lockUuid)
146         throws com.liferay.portal.PortalException,
147             com.liferay.portal.SystemException {
148         getService().unlockFileEntry(folderId, name, lockUuid);
149     }
150 
151     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
152         long folderId, long newFolderId, java.lang.String name,
153         java.lang.String sourceFileName, java.lang.String title,
154         java.lang.String description, java.lang.String extraSettings,
155         byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
156         throws com.liferay.portal.PortalException,
157             com.liferay.portal.SystemException {
158         return getService()
159                    .updateFileEntry(folderId, newFolderId, name,
160             sourceFileName, title, description, extraSettings, bytes,
161             serviceContext);
162     }
163 
164     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
165         long folderId, long newFolderId, java.lang.String name,
166         java.lang.String sourceFileName, java.lang.String title,
167         java.lang.String description, java.lang.String extraSettings,
168         java.io.File file,
169         com.liferay.portal.service.ServiceContext serviceContext)
170         throws com.liferay.portal.PortalException,
171             com.liferay.portal.SystemException {
172         return getService()
173                    .updateFileEntry(folderId, newFolderId, name,
174             sourceFileName, title, description, extraSettings, file,
175             serviceContext);
176     }
177 
178     public static boolean verifyFileEntryLock(long folderId,
179         java.lang.String name, java.lang.String lockUuid)
180         throws com.liferay.portal.PortalException,
181             com.liferay.portal.SystemException {
182         return getService().verifyFileEntryLock(folderId, name, lockUuid);
183     }
184 
185     public static DLFileEntryService getService() {
186         if (_service == null) {
187             _service = (DLFileEntryService)PortalBeanLocatorUtil.locate(DLFileEntryService.class.getName());
188         }
189 
190         return _service;
191     }
192 
193     public void setService(DLFileEntryService service) {
194         _service = service;
195     }
196 
197     private static DLFileEntryService _service;
198 }