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