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.rmi.RemoteException;
31
32
38 public class DLServiceUtil {
39
40 public static void addDirectory(
41 long companyId, long repositoryId, String dirName)
42 throws PortalException, RemoteException, SystemException {
43
44 DLService dlService = DLServiceFactory.getService();
45
46 dlService.addDirectory(companyId, repositoryId, dirName);
47 }
48
49 public static void addFile(
50 long companyId, String portletId, long groupId, long repositoryId,
51 String fileName, String properties, String[] tagsEntries, File file)
52 throws PortalException, RemoteException, SystemException {
53
54 DLService dlService = DLServiceFactory.getService();
55
56 dlService.addFile(
57 companyId, portletId, groupId, repositoryId, fileName, properties,
58 tagsEntries, file);
59 }
60
61 public static void addFile(
62 long companyId, String portletId, long groupId, long repositoryId,
63 String fileName, String properties, String[] tagsEntries,
64 byte[] byteArray)
65 throws PortalException, RemoteException, SystemException {
66
67 DLService dlService = DLServiceFactory.getService();
68
69 dlService.addFile(
70 companyId, portletId, groupId, repositoryId, fileName, properties,
71 tagsEntries, byteArray);
72 }
73
74 public static void deleteDirectory(
75 long companyId, String portletId, long repositoryId, String dirName)
76 throws PortalException, RemoteException, SystemException {
77
78 DLService dlService = DLServiceFactory.getService();
79
80 dlService.deleteDirectory(companyId, portletId, repositoryId, dirName);
81 }
82
83 public static void deleteFile(
84 long companyId, String portletId, long repositoryId,
85 String fileName)
86 throws PortalException, RemoteException, SystemException {
87
88 DLService dlService = DLServiceFactory.getService();
89
90 dlService.deleteFile(companyId, portletId, repositoryId, fileName);
91 }
92
93 public static void deleteFile(
94 long companyId, String portletId, long repositoryId,
95 String fileName, double versionNumber)
96 throws PortalException, RemoteException, SystemException {
97
98 DLService dlService = DLServiceFactory.getService();
99
100 dlService.deleteFile(
101 companyId, portletId, repositoryId, fileName, versionNumber);
102 }
103
104 public static byte[] getFile(
105 long companyId, long repositoryId, String fileName)
106 throws PortalException, RemoteException, SystemException {
107
108 DLService dlService = DLServiceFactory.getService();
109
110 return dlService.getFile(companyId, repositoryId, fileName);
111 }
112
113 public static byte[] getFile(
114 long companyId, long repositoryId, String fileName,
115 double versionNumber)
116 throws PortalException, RemoteException, SystemException {
117
118 DLService dlService = DLServiceFactory.getService();
119
120 return dlService.getFile(
121 companyId, repositoryId, fileName, versionNumber);
122 }
123
124 public static String[] getFileNames(
125 long companyId, long repositoryId, String dirName)
126 throws PortalException, RemoteException, SystemException {
127
128 DLService dlService = DLServiceFactory.getService();
129
130 return dlService.getFileNames(companyId, repositoryId, dirName);
131 }
132
133 public static long getFileSize(
134 long companyId, long repositoryId, String fileName)
135 throws PortalException, RemoteException, SystemException {
136
137 DLService dlService = DLServiceFactory.getService();
138
139 return dlService.getFileSize(companyId, repositoryId, fileName);
140 }
141
142 public static void reIndex(String[] ids)
143 throws PortalException, RemoteException, SystemException {
144
145 DLService dlService = DLServiceFactory.getService();
146
147 dlService.reIndex(ids);
148 }
149
150 public static void updateFile(
151 long companyId, String portletId, long groupId, long repositoryId,
152 String fileName, double versionNumber, String sourceFileName,
153 String properties, String[] tagsEntries, File file)
154 throws PortalException, RemoteException, SystemException {
155
156 DLService dlService = DLServiceFactory.getService();
157
158 dlService.updateFile(
159 companyId, portletId, groupId, repositoryId, fileName,
160 versionNumber, sourceFileName, properties, tagsEntries, file);
161 }
162
163 public static void updateFile(
164 long companyId, String portletId, long groupId, long repositoryId,
165 String fileName, double versionNumber, String sourceFileName,
166 String properties, String[] tagsEntries, byte[] byteArray)
167 throws PortalException, RemoteException, SystemException {
168
169 DLService dlService = DLServiceFactory.getService();
170
171 dlService.updateFile(
172 companyId, portletId, groupId, repositoryId, fileName,
173 versionNumber, sourceFileName, properties, tagsEntries, byteArray);
174 }
175
176 public static void updateFile(
177 long companyId, String portletId, long groupId, long repositoryId,
178 long newRepositoryId, String fileName)
179 throws PortalException, RemoteException, SystemException {
180
181 DLService dlService = DLServiceFactory.getService();
182
183 dlService.updateFile(
184 companyId, portletId, groupId, repositoryId, newRepositoryId,
185 fileName);
186 }
187
188 }