1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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  
26  /**
27   * <a href="DLFileEntryServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portlet.documentlibrary.service.DLFileEntryService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * @author Brian Wing Shun Chan
43   *
44   * @see com.liferay.portlet.documentlibrary.service.DLFileEntryService
45   *
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[] tagsEntries,
51          java.lang.String extraSettings, java.io.File file,
52          boolean addCommunityPermissions, boolean addGuestPermissions)
53          throws com.liferay.portal.PortalException,
54              com.liferay.portal.SystemException {
55          return getService()
56                     .addFileEntry(folderId, name, title, description,
57              tagsEntries, extraSettings, file, addCommunityPermissions,
58              addGuestPermissions);
59      }
60  
61      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
62          long folderId, java.lang.String name, java.lang.String title,
63          java.lang.String description, java.lang.String[] tagsEntries,
64          java.lang.String extraSettings, byte[] bytes,
65          boolean addCommunityPermissions, boolean addGuestPermissions)
66          throws com.liferay.portal.PortalException,
67              com.liferay.portal.SystemException {
68          return getService()
69                     .addFileEntry(folderId, name, title, description,
70              tagsEntries, extraSettings, bytes, addCommunityPermissions,
71              addGuestPermissions);
72      }
73  
74      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
75          long folderId, java.lang.String name, java.lang.String title,
76          java.lang.String description, java.lang.String[] tagsEntries,
77          java.lang.String extraSettings, java.io.File file,
78          java.lang.String[] communityPermissions,
79          java.lang.String[] guestPermissions)
80          throws com.liferay.portal.PortalException,
81              com.liferay.portal.SystemException {
82          return getService()
83                     .addFileEntry(folderId, name, title, description,
84              tagsEntries, extraSettings, file, communityPermissions,
85              guestPermissions);
86      }
87  
88      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
89          long folderId, java.lang.String name, java.lang.String title,
90          java.lang.String description, java.lang.String[] tagsEntries,
91          java.lang.String extraSettings, byte[] bytes,
92          java.lang.String[] communityPermissions,
93          java.lang.String[] guestPermissions)
94          throws com.liferay.portal.PortalException,
95              com.liferay.portal.SystemException {
96          return getService()
97                     .addFileEntry(folderId, name, title, description,
98              tagsEntries, extraSettings, bytes, communityPermissions,
99              guestPermissions);
100     }
101 
102     public static void deleteFileEntry(long folderId, java.lang.String name)
103         throws com.liferay.portal.PortalException,
104             com.liferay.portal.SystemException {
105         getService().deleteFileEntry(folderId, name);
106     }
107 
108     public static void deleteFileEntry(long folderId, java.lang.String name,
109         double version)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         getService().deleteFileEntry(folderId, name, version);
113     }
114 
115     public static void deleteFileEntryByTitle(long folderId,
116         java.lang.String titleWithExtension)
117         throws com.liferay.portal.PortalException,
118             com.liferay.portal.SystemException {
119         getService().deleteFileEntryByTitle(folderId, titleWithExtension);
120     }
121 
122     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
123         long folderId)
124         throws com.liferay.portal.PortalException,
125             com.liferay.portal.SystemException {
126         return getService().getFileEntries(folderId);
127     }
128 
129     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
130         long folderId, java.lang.String name)
131         throws com.liferay.portal.PortalException,
132             com.liferay.portal.SystemException {
133         return getService().getFileEntry(folderId, name);
134     }
135 
136     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
137         long folderId, java.lang.String titleWithExtension)
138         throws com.liferay.portal.PortalException,
139             com.liferay.portal.SystemException {
140         return getService().getFileEntryByTitle(folderId, titleWithExtension);
141     }
142 
143     public static boolean hasFileEntryLock(long folderId, java.lang.String name)
144         throws com.liferay.portal.PortalException {
145         return getService().hasFileEntryLock(folderId, name);
146     }
147 
148     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
149         java.lang.String name)
150         throws com.liferay.portal.PortalException,
151             com.liferay.portal.SystemException {
152         return getService().lockFileEntry(folderId, name);
153     }
154 
155     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
156         java.lang.String name, java.lang.String owner, long expirationTime)
157         throws com.liferay.portal.PortalException,
158             com.liferay.portal.SystemException {
159         return getService().lockFileEntry(folderId, name, owner, expirationTime);
160     }
161 
162     public static com.liferay.lock.model.Lock refreshFileEntryLock(
163         java.lang.String lockUuid, long expirationTime)
164         throws com.liferay.portal.PortalException {
165         return getService().refreshFileEntryLock(lockUuid, expirationTime);
166     }
167 
168     public static void unlockFileEntry(long folderId, java.lang.String name) {
169         getService().unlockFileEntry(folderId, name);
170     }
171 
172     public static void unlockFileEntry(long folderId, java.lang.String name,
173         java.lang.String lockUuid) throws com.liferay.portal.PortalException {
174         getService().unlockFileEntry(folderId, name, lockUuid);
175     }
176 
177     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
178         long folderId, long newFolderId, java.lang.String name,
179         java.lang.String sourceFileName, java.lang.String title,
180         java.lang.String description, java.lang.String[] tagsEntries,
181         java.lang.String extraSettings, byte[] bytes)
182         throws com.liferay.portal.PortalException,
183             com.liferay.portal.SystemException {
184         return getService()
185                    .updateFileEntry(folderId, newFolderId, name,
186             sourceFileName, title, description, tagsEntries, extraSettings,
187             bytes);
188     }
189 
190     public static boolean verifyFileEntryLock(long folderId,
191         java.lang.String name, java.lang.String lockUuid)
192         throws com.liferay.portal.PortalException {
193         return getService().verifyFileEntryLock(folderId, name, lockUuid);
194     }
195 
196     public static DLFileEntryService getService() {
197         if (_service == null) {
198             throw new RuntimeException("DLFileEntryService is not set");
199         }
200 
201         return _service;
202     }
203 
204     public void setService(DLFileEntryService service) {
205         _service = service;
206     }
207 
208     private static DLFileEntryService _service;
209 }