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