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