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