1
22
23 package com.liferay.documentlibrary.service;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27
28 import java.io.File;
29
30 import java.util.Date;
31
32
38 public class DLServiceUtil {
39
40 public static void addDirectory(
41 long companyId, long repositoryId, String dirName)
42 throws PortalException, SystemException {
43
44 _service.addDirectory(companyId, repositoryId, dirName);
45 }
46
47 public static void addFile(
48 long companyId, String portletId, long groupId, long repositoryId,
49 String fileName, long fileEntryId, String properties,
50 Date modifiedDate, String[] tagsCategories, String[] tagsEntries,
51 File file)
52 throws PortalException, SystemException {
53
54 _service.addFile(
55 companyId, portletId, groupId, repositoryId, fileName, fileEntryId,
56 properties, modifiedDate, tagsCategories, tagsEntries, file);
57 }
58
59 public static void addFile(
60 long companyId, String portletId, long groupId, long repositoryId,
61 String fileName, long fileEntryId, String properties,
62 Date modifiedDate, String[] tagsCategories, String[] tagsEntries,
63 byte[] bytes)
64 throws PortalException, SystemException {
65
66 _service.addFile(
67 companyId, portletId, groupId, repositoryId, fileName, fileEntryId,
68 properties, modifiedDate, tagsCategories, tagsEntries, bytes);
69 }
70
71 public static void deleteDirectory(
72 long companyId, String portletId, long repositoryId, String dirName)
73 throws PortalException, SystemException {
74
75 DLService _service = DLServiceFactory.getService();
76
77 _service.deleteDirectory(companyId, portletId, repositoryId, dirName);
78 }
79
80 public static void deleteFile(
81 long companyId, String portletId, long repositoryId,
82 String fileName)
83 throws PortalException, SystemException {
84
85 _service.deleteFile(companyId, portletId, repositoryId, fileName);
86 }
87
88 public static void deleteFile(
89 long companyId, String portletId, long repositoryId,
90 String fileName, double versionNumber)
91 throws PortalException, SystemException {
92
93 _service.deleteFile(
94 companyId, portletId, repositoryId, fileName, versionNumber);
95 }
96
97 public static byte[] getFile(
98 long companyId, long repositoryId, String fileName)
99 throws PortalException, SystemException {
100
101 return _service.getFile(companyId, repositoryId, fileName);
102 }
103
104 public static byte[] getFile(
105 long companyId, long repositoryId, String fileName,
106 double versionNumber)
107 throws PortalException, SystemException {
108
109 DLService _service = DLServiceFactory.getService();
110
111 return _service.getFile(
112 companyId, repositoryId, fileName, versionNumber);
113 }
114
115 public static String[] getFileNames(
116 long companyId, long repositoryId, String dirName)
117 throws PortalException, SystemException {
118
119 return _service.getFileNames(companyId, repositoryId, dirName);
120 }
121
122 public static long getFileSize(
123 long companyId, long repositoryId, String fileName)
124 throws PortalException, SystemException {
125
126 return _service.getFileSize(companyId, repositoryId, fileName);
127 }
128
129 public static void reIndex(String[] ids) throws SystemException {
130 _service.reIndex(ids);
131 }
132
133 public static void updateFile(
134 long companyId, String portletId, long groupId, long repositoryId,
135 String fileName, double versionNumber, String sourceFileName,
136 long fileEntryId, String properties, Date modifiedDate,
137 String[] tagsCategories, String[] tagsEntries, File file)
138 throws PortalException, SystemException {
139
140 _service.updateFile(
141 companyId, portletId, groupId, repositoryId, fileName,
142 versionNumber, sourceFileName, fileEntryId, properties,
143 modifiedDate, tagsCategories, tagsEntries, file);
144 }
145
146 public static void updateFile(
147 long companyId, String portletId, long groupId, long repositoryId,
148 String fileName, double versionNumber, String sourceFileName,
149 long fileEntryId, String properties, Date modifiedDate,
150 String[] tagsCategories, String[] tagsEntries, byte[] bytes)
151 throws PortalException, SystemException {
152
153 DLService _service = DLServiceFactory.getService();
154
155 _service.updateFile(
156 companyId, portletId, groupId, repositoryId, fileName,
157 versionNumber, sourceFileName, fileEntryId, properties,
158 modifiedDate, tagsCategories, tagsEntries, bytes);
159 }
160
161 public static void updateFile(
162 long companyId, String portletId, long groupId, long repositoryId,
163 long newRepositoryId, String fileName, long fileEntryId)
164 throws PortalException, SystemException {
165
166 _service.updateFile(
167 companyId, portletId, groupId, repositoryId, newRepositoryId,
168 fileName, fileEntryId);
169 }
170
171 public void setService(DLService service) {
172 _service = service;
173 }
174
175 private static DLService _service;
176
177 }