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, long fileEntryId, String properties,
44              Date modifiedDate, String[] tagsCategories, String[] tagsEntries,
45              InputStream is)
46          throws PortalException, SystemException;
47  
48      public void checkRoot(long companyId) throws SystemException;
49  
50      public InputStream getFileAsStream(
51              long companyId, long repositoryId, String fileName)
52          throws PortalException, SystemException;
53  
54      public InputStream getFileAsStream(
55              long companyId, long repositoryId, String fileName,
56              double versionNumber)
57          throws PortalException, SystemException;
58  
59      public boolean hasFile(
60              long companyId, long repositoryId, String fileName,
61              double versionNumber)
62          throws PortalException, SystemException;
63  
64      public void move(String srcDir, String destDir) throws SystemException;
65  
66      public Hits search(
67              long companyId, String portletId, long groupId,
68              long userId, long[] repositoryIds, String keywords, int start,
69              int end)
70          throws SystemException;
71  
72      public void updateFile(
73              long companyId, String portletId, long groupId, long repositoryId,
74              String fileName, double versionNumber, String sourceFileName,
75              long fileEntryId, String properties, Date modifiedDate,
76              String[] tagsCategories, String[] tagsEntries, InputStream is)
77          throws PortalException, SystemException;
78  
79      public void validate(String fileName, File file)
80          throws PortalException, SystemException;
81  
82      public void validate(String fileName, byte[] bytes)
83          throws PortalException, SystemException;
84  
85      public void validate(String fileName, InputStream is)
86          throws PortalException, SystemException;
87  
88      public void validate(String fileName, String sourceFileName, InputStream is)
89          throws PortalException;
90  
91  }