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