1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.documentlibrary.service;
16  
17  import com.liferay.portal.kernel.annotation.Transactional;
18  import com.liferay.portal.kernel.exception.PortalException;
19  import com.liferay.portal.kernel.exception.SystemException;
20  import com.liferay.portal.kernel.search.Hits;
21  import com.liferay.portal.service.ServiceContext;
22  
23  import java.io.File;
24  import java.io.InputStream;
25  
26  import java.util.Date;
27  
28  @Transactional(rollbackFor = {PortalException.class, SystemException.class})
29  /**
30   * <a href="DLLocalService.java.html"><b><i>View Source</i></b></a>
31   *
32   * @author Brian Wing Shun Chan
33   */
34  public interface DLLocalService {
35  
36      public void addFile(
37              long companyId, String portletId, long groupId, long repositoryId,
38              String fileName, boolean validateFileExtension, long fileEntryId,
39              String properties, Date modifiedDate, ServiceContext serviceContext,
40              InputStream is)
41          throws PortalException, SystemException;
42  
43      public void checkRoot(long companyId) throws SystemException;
44  
45      public InputStream getFileAsStream(
46              long companyId, long repositoryId, String fileName)
47          throws PortalException, SystemException;
48  
49      public InputStream getFileAsStream(
50              long companyId, long repositoryId, String fileName,
51              String versionNumber)
52          throws PortalException, SystemException;
53  
54      public boolean hasFile(
55              long companyId, long repositoryId, String fileName,
56              String versionNumber)
57          throws PortalException, SystemException;
58  
59      public void move(String srcDir, String destDir) throws SystemException;
60  
61      public Hits search(
62              long companyId, String portletId, long groupId,
63              long userId, long[] repositoryIds, String keywords, int start,
64              int end)
65          throws SystemException;
66  
67      public void updateFile(
68              long companyId, String portletId, long groupId, long repositoryId,
69              String fileName, boolean validateFileExtension,
70              String versionNumber, String sourceFileName, long fileEntryId,
71              String properties, Date modifiedDate, ServiceContext serviceContext,
72              InputStream is)
73          throws PortalException, SystemException;
74  
75      public void validate(
76              String fileName, boolean validateFileExtension, byte[] bytes)
77          throws PortalException, SystemException;
78  
79      public void validate(
80              String fileName, boolean validateFileExtension, File file)
81          throws PortalException, SystemException;
82  
83      public void validate(
84              String fileName, boolean validateFileExtension, InputStream is)
85          throws PortalException, SystemException;
86  
87      public void validate(String fileName, String sourceFileName, InputStream is)
88          throws PortalException, SystemException;
89  
90  }