1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.documentlibrary.service;
21  
22  
23  /**
24   * <a href="DLFileEntryServiceUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides static methods for the
33   * <code>com.liferay.portlet.documentlibrary.service.DLFileEntryService</code>
34   * bean. The static methods of this class calls the same methods of the bean
35   * instance. It's convenient to be able to just write one line to call a method
36   * on a bean instead of writing a lookup call and a method call.
37   * </p>
38   *
39   * @author Brian Wing Shun Chan
40   *
41   * @see com.liferay.portlet.documentlibrary.service.DLFileEntryService
42   *
43   */
44  public class DLFileEntryServiceUtil {
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[] tagsEntries,
48          java.lang.String extraSettings, java.io.File file,
49          boolean addCommunityPermissions, boolean addGuestPermissions)
50          throws com.liferay.portal.PortalException,
51              com.liferay.portal.SystemException, java.rmi.RemoteException {
52          return getService()
53                     .addFileEntry(folderId, name, title, description,
54              tagsEntries, extraSettings, file, addCommunityPermissions,
55              addGuestPermissions);
56      }
57  
58      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
59          long folderId, java.lang.String name, java.lang.String title,
60          java.lang.String description, java.lang.String[] tagsEntries,
61          java.lang.String extraSettings, byte[] bytes,
62          boolean addCommunityPermissions, boolean addGuestPermissions)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException, java.rmi.RemoteException {
65          return getService()
66                     .addFileEntry(folderId, name, title, description,
67              tagsEntries, extraSettings, bytes, addCommunityPermissions,
68              addGuestPermissions);
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[] tagsEntries,
74          java.lang.String extraSettings, java.io.File file,
75          java.lang.String[] communityPermissions,
76          java.lang.String[] guestPermissions)
77          throws com.liferay.portal.PortalException,
78              com.liferay.portal.SystemException, java.rmi.RemoteException {
79          return getService()
80                     .addFileEntry(folderId, name, title, description,
81              tagsEntries, extraSettings, file, communityPermissions,
82              guestPermissions);
83      }
84  
85      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
86          long folderId, java.lang.String name, java.lang.String title,
87          java.lang.String description, java.lang.String[] tagsEntries,
88          java.lang.String extraSettings, byte[] bytes,
89          java.lang.String[] communityPermissions,
90          java.lang.String[] guestPermissions)
91          throws com.liferay.portal.PortalException,
92              com.liferay.portal.SystemException, java.rmi.RemoteException {
93          return getService()
94                     .addFileEntry(folderId, name, title, description,
95              tagsEntries, extraSettings, bytes, communityPermissions,
96              guestPermissions);
97      }
98  
99      public static void deleteFileEntry(long folderId, java.lang.String name)
100         throws com.liferay.portal.PortalException,
101             com.liferay.portal.SystemException, java.rmi.RemoteException {
102         getService().deleteFileEntry(folderId, name);
103     }
104 
105     public static void deleteFileEntry(long folderId, java.lang.String name,
106         double version)
107         throws com.liferay.portal.PortalException,
108             com.liferay.portal.SystemException, java.rmi.RemoteException {
109         getService().deleteFileEntry(folderId, name, version);
110     }
111 
112     public static void deleteFileEntryByTitle(long folderId,
113         java.lang.String titleWithExtension)
114         throws com.liferay.portal.PortalException,
115             com.liferay.portal.SystemException, java.rmi.RemoteException {
116         getService().deleteFileEntryByTitle(folderId, titleWithExtension);
117     }
118 
119     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
120         long folderId)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException, java.rmi.RemoteException {
123         return getService().getFileEntries(folderId);
124     }
125 
126     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
127         long folderId, java.lang.String name)
128         throws com.liferay.portal.PortalException,
129             com.liferay.portal.SystemException, java.rmi.RemoteException {
130         return getService().getFileEntry(folderId, name);
131     }
132 
133     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
134         long folderId, java.lang.String titleWithExtension)
135         throws com.liferay.portal.PortalException,
136             com.liferay.portal.SystemException, java.rmi.RemoteException {
137         return getService().getFileEntryByTitle(folderId, titleWithExtension);
138     }
139 
140     public static com.liferay.lock.model.Lock getFileEntryLock(long folderId,
141         java.lang.String name)
142         throws com.liferay.portal.PortalException, java.rmi.RemoteException {
143         return getService().getFileEntryLock(folderId, name);
144     }
145 
146     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
147         java.lang.String name)
148         throws com.liferay.portal.PortalException,
149             com.liferay.portal.SystemException, java.rmi.RemoteException {
150         return getService().lockFileEntry(folderId, name);
151     }
152 
153     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
154         java.lang.String name, java.lang.String owner, long expirationTime)
155         throws com.liferay.portal.PortalException,
156             com.liferay.portal.SystemException, java.rmi.RemoteException {
157         return getService().lockFileEntry(folderId, name, owner, expirationTime);
158     }
159 
160     public static com.liferay.lock.model.Lock refreshFileEntryLock(
161         java.lang.String lockUuid, long expirationTime)
162         throws com.liferay.portal.PortalException, java.rmi.RemoteException {
163         return getService().refreshFileEntryLock(lockUuid, expirationTime);
164     }
165 
166     public static void unlockFileEntry(long folderId, java.lang.String name)
167         throws java.rmi.RemoteException {
168         getService().unlockFileEntry(folderId, name);
169     }
170 
171     public static void unlockFileEntry(long folderId, java.lang.String name,
172         java.lang.String lockUuid)
173         throws com.liferay.portal.PortalException, java.rmi.RemoteException {
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, java.rmi.RemoteException {
184         return getService()
185                    .updateFileEntry(folderId, newFolderId, name,
186             sourceFileName, title, description, tagsEntries, extraSettings,
187             bytes);
188     }
189 
190     public static DLFileEntryService getService() {
191         if (_service == null) {
192             throw new RuntimeException("DLFileEntryService is not set");
193         }
194 
195         return _service;
196     }
197 
198     public void setService(DLFileEntryService service) {
199         _service = service;
200     }
201 
202     private static DLFileEntryService _service;
203 }