1   /**
2    * Copyright (c) 2000-2008 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  /**
33   * <a href="DLLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
34   *
35   * @author Brian Wing Shun Chan
36   *
37   */
38  public class DLLocalServiceUtil {
39  
40      public static void addFile(
41              long companyId, String portletId, long groupId, long repositoryId,
42              String fileName, String properties, String[] tagsEntries,
43              InputStream is)
44          throws PortalException, SystemException {
45  
46          _service.addFile(
47              companyId, portletId, groupId, repositoryId, fileName, properties,
48              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[] repositoryIds, String keywords, int start, int end)
89          throws SystemException {
90  
91          return _service.search(
92              companyId, portletId, groupId, repositoryIds, keywords, start, end);
93      }
94  
95      public static void updateFile(
96              long companyId, String portletId, long groupId, long repositoryId,
97              String fileName, double versionNumber, String sourceFileName,
98              String properties, String[] tagsEntries, InputStream is)
99          throws PortalException, SystemException {
100 
101         _service.updateFile(
102             companyId, portletId, groupId, repositoryId, fileName,
103             versionNumber, sourceFileName, properties, tagsEntries, is);
104     }
105 
106     public static void validate(String fileName, File file)
107         throws PortalException {
108 
109         _service.validate(fileName, file);
110     }
111 
112     public static void validate(String fileName, byte[] bytes)
113         throws PortalException {
114 
115         _service.validate(fileName, bytes);
116     }
117 
118     public static void validate(String fileName, InputStream is)
119         throws PortalException {
120 
121         _service.validate(fileName, is);
122     }
123 
124     public static void validate(
125             String fileName, String sourceFileName, InputStream is)
126         throws PortalException {
127 
128         _service.validate(fileName, sourceFileName, is);
129     }
130 
131     public void setService(DLLocalService service) {
132         _service = service;
133     }
134 
135     private static DLLocalService _service;
136 
137 }