1   /**
2    * Copyright (c) 2000-2008 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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
140         return getService().getFileEntryByTitle(folderId, titleWithExtension);
141     }
142 
143     public static com.liferay.lock.model.Lock getFileEntryLock(long folderId,
144         java.lang.String name)
145         throws com.liferay.portal.PortalException, java.rmi.RemoteException {
146         return getService().getFileEntryLock(folderId, name);
147     }
148 
149     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
150         java.lang.String name)
151         throws com.liferay.portal.PortalException,
152             com.liferay.portal.SystemException, java.rmi.RemoteException {
153         return getService().lockFileEntry(folderId, name);
154     }
155 
156     public static com.liferay.lock.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, java.rmi.RemoteException {
160         return getService().lockFileEntry(folderId, name, owner, expirationTime);
161     }
162 
163     public static com.liferay.lock.model.Lock refreshFileEntryLock(
164         java.lang.String lockUuid, long expirationTime)
165         throws com.liferay.portal.PortalException, java.rmi.RemoteException {
166         return getService().refreshFileEntryLock(lockUuid, expirationTime);
167     }
168 
169     public static void unlockFileEntry(long folderId, java.lang.String name)
170         throws java.rmi.RemoteException {
171         getService().unlockFileEntry(folderId, name);
172     }
173 
174     public static void unlockFileEntry(long folderId, java.lang.String name,
175         java.lang.String lockUuid)
176         throws com.liferay.portal.PortalException, java.rmi.RemoteException {
177         getService().unlockFileEntry(folderId, name, lockUuid);
178     }
179 
180     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
181         long folderId, long newFolderId, java.lang.String name,
182         java.lang.String sourceFileName, java.lang.String title,
183         java.lang.String description, java.lang.String[] tagsEntries,
184         java.lang.String extraSettings, byte[] bytes)
185         throws com.liferay.portal.PortalException,
186             com.liferay.portal.SystemException, java.rmi.RemoteException {
187         return getService()
188                    .updateFileEntry(folderId, newFolderId, name,
189             sourceFileName, title, description, tagsEntries, extraSettings,
190             bytes);
191     }
192 
193     public static DLFileEntryService getService() {
194         if (_service == null) {
195             throw new RuntimeException("DLFileEntryService is not set");
196         }
197 
198         return _service;
199     }
200 
201     public void setService(DLFileEntryService service) {
202         _service = service;
203     }
204 
205     private static DLFileEntryService _service;
206 }