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  
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   * {@link DLFileEntryService} bean. The static methods of
37   * this class calls the same methods of the bean instance. It's convenient to be
38   * able to just write one line to call a method on a bean instead of writing a
39   * lookup call and a method call.
40   * </p>
41   *
42   * @author    Brian Wing Shun Chan
43   * @see       DLFileEntryService
44   * @generated
45   */
46  public class DLFileEntryServiceUtil {
47      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
48          long folderId, java.lang.String name, java.lang.String title,
49          java.lang.String description, java.lang.String extraSettings,
50          java.io.File file,
51          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, file, 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          byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          return getService()
66                     .addFileEntry(folderId, name, title, description,
67              extraSettings, bytes, serviceContext);
68      }
69  
70      public static void deleteFileEntry(long folderId, java.lang.String name)
71          throws com.liferay.portal.PortalException,
72              com.liferay.portal.SystemException {
73          getService().deleteFileEntry(folderId, name);
74      }
75  
76      public static void deleteFileEntry(long folderId, java.lang.String name,
77          double version)
78          throws com.liferay.portal.PortalException,
79              com.liferay.portal.SystemException {
80          getService().deleteFileEntry(folderId, name, version);
81      }
82  
83      public static void deleteFileEntryByTitle(long folderId,
84          java.lang.String titleWithExtension)
85          throws com.liferay.portal.PortalException,
86              com.liferay.portal.SystemException {
87          getService().deleteFileEntryByTitle(folderId, titleWithExtension);
88      }
89  
90      public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
91          long folderId)
92          throws com.liferay.portal.PortalException,
93              com.liferay.portal.SystemException {
94          return getService().getFileEntries(folderId);
95      }
96  
97      public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
98          long folderId, java.lang.String name)
99          throws com.liferay.portal.PortalException,
100             com.liferay.portal.SystemException {
101         return getService().getFileEntry(folderId, name);
102     }
103 
104     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
105         long folderId, java.lang.String titleWithExtension)
106         throws com.liferay.portal.PortalException,
107             com.liferay.portal.SystemException {
108         return getService().getFileEntryByTitle(folderId, titleWithExtension);
109     }
110 
111     public static boolean hasFileEntryLock(long folderId, java.lang.String name)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException {
114         return getService().hasFileEntryLock(folderId, name);
115     }
116 
117     public static com.liferay.portal.model.Lock lockFileEntry(long folderId,
118         java.lang.String name)
119         throws com.liferay.portal.PortalException,
120             com.liferay.portal.SystemException {
121         return getService().lockFileEntry(folderId, name);
122     }
123 
124     public static com.liferay.portal.model.Lock lockFileEntry(long folderId,
125         java.lang.String name, java.lang.String owner, long expirationTime)
126         throws com.liferay.portal.PortalException,
127             com.liferay.portal.SystemException {
128         return getService().lockFileEntry(folderId, name, owner, expirationTime);
129     }
130 
131     public static com.liferay.portal.model.Lock refreshFileEntryLock(
132         java.lang.String lockUuid, long expirationTime)
133         throws com.liferay.portal.PortalException,
134             com.liferay.portal.SystemException {
135         return getService().refreshFileEntryLock(lockUuid, expirationTime);
136     }
137 
138     public static void unlockFileEntry(long folderId, java.lang.String name)
139         throws com.liferay.portal.SystemException {
140         getService().unlockFileEntry(folderId, name);
141     }
142 
143     public static void unlockFileEntry(long folderId, java.lang.String name,
144         java.lang.String lockUuid)
145         throws com.liferay.portal.PortalException,
146             com.liferay.portal.SystemException {
147         getService().unlockFileEntry(folderId, name, lockUuid);
148     }
149 
150     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
151         long folderId, long newFolderId, java.lang.String name,
152         java.lang.String sourceFileName, java.lang.String title,
153         java.lang.String description, java.lang.String extraSettings,
154         byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
155         throws com.liferay.portal.PortalException,
156             com.liferay.portal.SystemException {
157         return getService()
158                    .updateFileEntry(folderId, newFolderId, name,
159             sourceFileName, title, description, extraSettings, bytes,
160             serviceContext);
161     }
162 
163     public static boolean verifyFileEntryLock(long folderId,
164         java.lang.String name, java.lang.String lockUuid)
165         throws com.liferay.portal.PortalException,
166             com.liferay.portal.SystemException {
167         return getService().verifyFileEntryLock(folderId, name, lockUuid);
168     }
169 
170     public static DLFileEntryService getService() {
171         if (_service == null) {
172             throw new RuntimeException("DLFileEntryService is not set");
173         }
174 
175         return _service;
176     }
177 
178     public void setService(DLFileEntryService service) {
179         _service = service;
180     }
181 
182     private static DLFileEntryService _service;
183 }