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.annotation.Transactional;
25  import com.liferay.portal.kernel.search.Hits;
26  
27  import java.io.File;
28  import java.io.InputStream;
29  
30  import java.util.Date;
31  
32  /**
33   * <a href="DLLocalService.java.html"><b><i>View Source</i></b></a>
34   *
35   * @author Brian Wing Shun Chan
36   *
37   */
38  @Transactional(rollbackFor = {PortalException.class, SystemException.class})
39  public interface DLLocalService {
40  
41      public 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      public void checkRoot(long companyId) throws SystemException;
48  
49      public InputStream getFileAsStream(
50              long companyId, long repositoryId, String fileName)
51          throws PortalException, SystemException;
52  
53      public InputStream getFileAsStream(
54              long companyId, long repositoryId, String fileName,
55              double versionNumber)
56          throws PortalException, SystemException;
57  
58      public boolean hasFile(
59              long companyId, long repositoryId, String fileName,
60              double versionNumber)
61          throws PortalException, SystemException;
62  
63      public void move(String srcDir, String destDir) throws SystemException;
64  
65      public Hits search(
66              long companyId, String portletId, long groupId,
67              long[] repositoryIds, String keywords, int start, int end)
68          throws SystemException;
69  
70      public void updateFile(
71              long companyId, String portletId, long groupId, long repositoryId,
72              String fileName, double versionNumber, String sourceFileName,
73              String properties, Date modifiedDate, String[] tagsEntries,
74              InputStream is)
75          throws PortalException, SystemException;
76  
77      public void validate(String fileName, File file)
78          throws PortalException, SystemException;
79  
80      public void validate(String fileName, byte[] bytes)
81          throws PortalException, SystemException;
82  
83      public void validate(String fileName, InputStream is)
84          throws PortalException, SystemException;
85  
86      public void validate(String fileName, String sourceFileName, InputStream is)
87          throws PortalException;
88  
89  }