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 extraSettings,
48          java.io.File file,
49          com.liferay.portal.service.ServiceContext serviceContext)
50          throws com.liferay.portal.PortalException,
51              com.liferay.portal.SystemException {
52          return getService()
53                     .addFileEntry(folderId, name, title, description,
54              extraSettings, file, serviceContext);
55      }
56  
57      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
58          long folderId, java.lang.String name, java.lang.String title,
59          java.lang.String description, java.lang.String extraSettings,
60          byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
61          throws com.liferay.portal.PortalException,
62              com.liferay.portal.SystemException {
63          return getService()
64                     .addFileEntry(folderId, name, title, description,
65              extraSettings, bytes, serviceContext);
66      }
67  
68      public static void deleteFileEntry(long folderId, java.lang.String name)
69          throws com.liferay.portal.PortalException,
70              com.liferay.portal.SystemException {
71          getService().deleteFileEntry(folderId, name);
72      }
73  
74      public static void deleteFileEntry(long folderId, java.lang.String name,
75          double version)
76          throws com.liferay.portal.PortalException,
77              com.liferay.portal.SystemException {
78          getService().deleteFileEntry(folderId, name, version);
79      }
80  
81      public static void deleteFileEntryByTitle(long folderId,
82          java.lang.String titleWithExtension)
83          throws com.liferay.portal.PortalException,
84              com.liferay.portal.SystemException {
85          getService().deleteFileEntryByTitle(folderId, titleWithExtension);
86      }
87  
88      public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
89          long folderId)
90          throws com.liferay.portal.PortalException,
91              com.liferay.portal.SystemException {
92          return getService().getFileEntries(folderId);
93      }
94  
95      public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
96          long folderId, java.lang.String name)
97          throws com.liferay.portal.PortalException,
98              com.liferay.portal.SystemException {
99          return getService().getFileEntry(folderId, name);
100     }
101 
102     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
103         long folderId, java.lang.String titleWithExtension)
104         throws com.liferay.portal.PortalException,
105             com.liferay.portal.SystemException {
106         return getService().getFileEntryByTitle(folderId, titleWithExtension);
107     }
108 
109     public static boolean hasFileEntryLock(long folderId, java.lang.String name)
110         throws com.liferay.portal.PortalException {
111         return getService().hasFileEntryLock(folderId, name);
112     }
113 
114     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
115         java.lang.String name)
116         throws com.liferay.portal.PortalException,
117             com.liferay.portal.SystemException {
118         return getService().lockFileEntry(folderId, name);
119     }
120 
121     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
122         java.lang.String name, java.lang.String owner, long expirationTime)
123         throws com.liferay.portal.PortalException,
124             com.liferay.portal.SystemException {
125         return getService().lockFileEntry(folderId, name, owner, expirationTime);
126     }
127 
128     public static com.liferay.lock.model.Lock refreshFileEntryLock(
129         java.lang.String lockUuid, long expirationTime)
130         throws com.liferay.portal.PortalException {
131         return getService().refreshFileEntryLock(lockUuid, expirationTime);
132     }
133 
134     public static void unlockFileEntry(long folderId, java.lang.String name) {
135         getService().unlockFileEntry(folderId, name);
136     }
137 
138     public static void unlockFileEntry(long folderId, java.lang.String name,
139         java.lang.String lockUuid) throws com.liferay.portal.PortalException {
140         getService().unlockFileEntry(folderId, name, lockUuid);
141     }
142 
143     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
144         long folderId, long newFolderId, java.lang.String name,
145         java.lang.String sourceFileName, java.lang.String title,
146         java.lang.String description, java.lang.String extraSettings,
147         byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
148         throws com.liferay.portal.PortalException,
149             com.liferay.portal.SystemException {
150         return getService()
151                    .updateFileEntry(folderId, newFolderId, name,
152             sourceFileName, title, description, extraSettings, bytes,
153             serviceContext);
154     }
155 
156     public static boolean verifyFileEntryLock(long folderId,
157         java.lang.String name, java.lang.String lockUuid)
158         throws com.liferay.portal.PortalException {
159         return getService().verifyFileEntryLock(folderId, name, lockUuid);
160     }
161 
162     public static DLFileEntryService getService() {
163         if (_service == null) {
164             throw new RuntimeException("DLFileEntryService is not set");
165         }
166 
167         return _service;
168     }
169 
170     public void setService(DLFileEntryService service) {
171         _service = service;
172     }
173 
174     private static DLFileEntryService _service;
175 }