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.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  public class DLLocalServiceUtil {
40  
41      public static void addFile(
42              long companyId, String portletId, long groupId, long repositoryId,
43              String fileName, String properties, Date modifiedDate,
44              String[] tagsEntries, InputStream is)
45          throws PortalException, SystemException {
46  
47          _service.addFile(
48              companyId, portletId, groupId, repositoryId, fileName, properties,
49              modifiedDate, tagsEntries, is);
50      }
51  
52      public static void checkRoot(long companyId) throws SystemException {
53          _service.checkRoot(companyId);
54      }
55  
56      public static InputStream getFileAsStream(
57              long companyId, long repositoryId, String fileName)
58          throws PortalException, SystemException {
59  
60          return _service.getFileAsStream(companyId, repositoryId, fileName);
61      }
62  
63      public static InputStream getFileAsStream(
64              long companyId, long repositoryId, String fileName,
65              double versionNumber)
66          throws PortalException, SystemException {
67  
68          return _service.getFileAsStream(
69              companyId, repositoryId, fileName, versionNumber);
70      }
71  
72      public static boolean hasFile(
73              long companyId, long repositoryId, String fileName,
74              double versionNumber)
75          throws PortalException, SystemException {
76  
77          return _service.hasFile(
78              companyId, repositoryId, fileName, versionNumber);
79      }
80  
81      public static void move(String srcDir, String destDir)
82          throws SystemException {
83  
84          _service.move(srcDir, destDir);
85      }
86  
87      public static Hits search(
88              long companyId, String portletId, long groupId,
89              long[] repositoryIds, String keywords, int start, int end)
90          throws SystemException {
91  
92          return _service.search(
93              companyId, portletId, groupId, repositoryIds, keywords, start, end);
94      }
95  
96      public static void updateFile(
97              long companyId, String portletId, long groupId, long repositoryId,
98              String fileName, double versionNumber, String sourceFileName,
99              String properties, Date modifiedDate, String[] tagsEntries,
100             InputStream is)
101         throws PortalException, SystemException {
102 
103         _service.updateFile(
104             companyId, portletId, groupId, repositoryId, fileName,
105             versionNumber, sourceFileName, properties, modifiedDate,
106             tagsEntries, is);
107     }
108 
109     public static void validate(String fileName, File file)
110         throws PortalException, SystemException {
111 
112         _service.validate(fileName, file);
113     }
114 
115     public static void validate(String fileName, byte[] bytes)
116         throws PortalException, SystemException {
117 
118         _service.validate(fileName, bytes);
119     }
120 
121     public static void validate(String fileName, InputStream is)
122         throws PortalException, SystemException {
123 
124         _service.validate(fileName, is);
125     }
126 
127     public static void validate(
128             String fileName, String sourceFileName, InputStream is)
129         throws PortalException {
130 
131         _service.validate(fileName, sourceFileName, is);
132     }
133 
134     public void setService(DLLocalService service) {
135         _service = service;
136     }
137 
138     private static DLLocalService _service;
139 
140 }