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 import java.util.Date;
33
34
40 public class DLServiceUtil {
41
42 public static void addDirectory(
43 long companyId, long repositoryId, String dirName)
44 throws PortalException, RemoteException, SystemException {
45
46 _service.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, Date modifiedDate,
52 String[] tagsEntries, byte[] bytes)
53 throws PortalException, RemoteException, SystemException {
54
55 _service.addFile(
56 companyId, portletId, groupId, repositoryId, fileName, properties,
57 modifiedDate, tagsEntries, bytes);
58 }
59
60 public static void addFile(
61 long companyId, String portletId, long groupId, long repositoryId,
62 String fileName, String properties, Date modifiedDate,
63 String[] tagsEntries, File file)
64 throws PortalException, RemoteException, SystemException {
65
66 _service.addFile(
67 companyId, portletId, groupId, repositoryId, fileName, properties,
68 modifiedDate, tagsEntries, file);
69 }
70
71 public static void deleteDirectory(
72 long companyId, String portletId, long repositoryId, String dirName)
73 throws PortalException, RemoteException, 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, RemoteException, 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, RemoteException, 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, RemoteException, 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, RemoteException, 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, RemoteException, 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, RemoteException, SystemException {
125
126 return _service.getFileSize(companyId, repositoryId, fileName);
127 }
128
129 public static void reIndex(String[] ids)
130 throws RemoteException, SystemException {
131
132 _service.reIndex(ids);
133 }
134
135 public static void updateFile(
136 long companyId, String portletId, long groupId, long repositoryId,
137 String fileName, double versionNumber, String sourceFileName,
138 String properties, Date modifiedDate, String[] tagsEntries,
139 byte[] bytes)
140 throws PortalException, RemoteException, SystemException {
141
142 DLService _service = DLServiceFactory.getService();
143
144 _service.updateFile(
145 companyId, portletId, groupId, repositoryId, fileName,
146 versionNumber, sourceFileName, properties, modifiedDate,
147 tagsEntries, bytes);
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, Date modifiedDate, String[] tagsEntries,
154 File file)
155 throws PortalException, RemoteException, SystemException {
156
157 _service.updateFile(
158 companyId, portletId, groupId, repositoryId, fileName,
159 versionNumber, sourceFileName, properties, modifiedDate,
160 tagsEntries, file);
161 }
162
163 public static void updateFile(
164 long companyId, String portletId, long groupId, long repositoryId,
165 long newRepositoryId, String fileName)
166 throws PortalException, RemoteException, SystemException {
167
168 _service.updateFile(
169 companyId, portletId, groupId, repositoryId, newRepositoryId,
170 fileName);
171 }
172
173 public void setService(DLService service) {
174 _service = service;
175 }
176
177 private static DLService _service;
178
179 }