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.documentlibrary.service;
21  
22  import com.liferay.portal.PortalException;
23  import com.liferay.portal.SystemException;
24  import com.liferay.portal.kernel.search.Hits;
25  
26  import java.io.File;
27  import java.io.InputStream;
28  
29  import java.util.Date;
30  
31  /**
32   * <a href="DLLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
33   *
34   * @author Brian Wing Shun Chan
35   *
36   */
37  public class DLLocalServiceUtil {
38  
39      public static void addFile(
40              long companyId, String portletId, long groupId, long repositoryId,
41              String fileName, long fileEntryId, String properties,
42              Date modifiedDate, String[] tagsCategories, String[] tagsEntries,
43              InputStream is)
44          throws PortalException, SystemException {
45  
46          _service.addFile(
47              companyId, portletId, groupId, repositoryId, fileName, fileEntryId,
48              properties, modifiedDate, tagsCategories, tagsEntries, is);
49      }
50  
51      public static void checkRoot(long companyId) throws SystemException {
52          _service.checkRoot(companyId);
53      }
54  
55      public static InputStream getFileAsStream(
56              long companyId, long repositoryId, String fileName)
57          throws PortalException, SystemException {
58  
59          return _service.getFileAsStream(companyId, repositoryId, fileName);
60      }
61  
62      public static InputStream getFileAsStream(
63              long companyId, long repositoryId, String fileName,
64              double versionNumber)
65          throws PortalException, SystemException {
66  
67          return _service.getFileAsStream(
68              companyId, repositoryId, fileName, versionNumber);
69      }
70  
71      public static boolean hasFile(
72              long companyId, long repositoryId, String fileName,
73              double versionNumber)
74          throws PortalException, SystemException {
75  
76          return _service.hasFile(
77              companyId, repositoryId, fileName, versionNumber);
78      }
79  
80      public static void move(String srcDir, String destDir)
81          throws SystemException {
82  
83          _service.move(srcDir, destDir);
84      }
85  
86      public static Hits search(
87              long companyId, String portletId, long groupId,
88              long userId, long[] repositoryIds, String keywords, int start,
89              int end)
90          throws SystemException {
91  
92          return _service.search(
93              companyId, portletId, groupId, userId, repositoryIds, keywords,
94              start, end);
95      }
96  
97      public static void updateFile(
98              long companyId, String portletId, long groupId, long repositoryId,
99              String fileName, double versionNumber, String sourceFileName,
100             long fileEntryId, String properties, Date modifiedDate,
101             String[] tagsCategories, String[] tagsEntries, InputStream is)
102         throws PortalException, SystemException {
103 
104         _service.updateFile(
105             companyId, portletId, groupId, repositoryId, fileName,
106             versionNumber, sourceFileName, fileEntryId, properties,
107             modifiedDate, tagsCategories, tagsEntries, is);
108     }
109 
110     public static void validate(String fileName, File file)
111         throws PortalException, SystemException {
112 
113         _service.validate(fileName, file);
114     }
115 
116     public static void validate(String fileName, byte[] bytes)
117         throws PortalException, SystemException {
118 
119         _service.validate(fileName, bytes);
120     }
121 
122     public static void validate(String fileName, InputStream is)
123         throws PortalException, SystemException {
124 
125         _service.validate(fileName, is);
126     }
127 
128     public static void validate(
129             String fileName, String sourceFileName, InputStream is)
130         throws PortalException {
131 
132         _service.validate(fileName, sourceFileName, is);
133     }
134 
135     public void setService(DLLocalService service) {
136         _service = service;
137     }
138 
139     private static DLLocalService _service;
140 
141 }