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.portlet.documentlibrary.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.BooleanWrapper;
20  import com.liferay.portal.kernel.util.LongWrapper;
21  import com.liferay.portal.kernel.util.MethodWrapper;
22  import com.liferay.portal.kernel.util.NullWrapper;
23  import com.liferay.portal.security.auth.HttpPrincipal;
24  import com.liferay.portal.service.http.TunnelUtil;
25  
26  import com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil;
27  
28  /**
29   * <a href="DLFileEntryServiceHttp.java.html"><b><i>View Source</i></b></a>
30   *
31   * <p>
32   * ServiceBuilder generated this class. Modifications in this class will be
33   * overwritten the next time is generated.
34   * </p>
35   *
36   * <p>
37   * This class provides a HTTP utility for the
38   * {@link com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil} service utility. The
39   * static methods of this class calls the same methods of the service utility.
40   * However, the signatures are different because it requires an additional
41   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
42   * </p>
43   *
44   * <p>
45   * The benefits of using the HTTP utility is that it is fast and allows for
46   * tunneling without the cost of serializing to text. The drawback is that it
47   * only works with Java.
48   * </p>
49   *
50   * <p>
51   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
52   * configure security.
53   * </p>
54   *
55   * <p>
56   * The HTTP utility is only generated for remote services.
57   * </p>
58   *
59   * @author    Brian Wing Shun Chan
60   * @see       DLFileEntryServiceSoap
61   * @see       com.liferay.portal.security.auth.HttpPrincipal
62   * @see       com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil
63   * @generated
64   */
65  public class DLFileEntryServiceHttp {
66      public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
67          HttpPrincipal httpPrincipal, long groupId, long folderId,
68          java.lang.String name, java.lang.String title,
69          java.lang.String description, java.lang.String versionDescription,
70          java.lang.String extraSettings, byte[] bytes,
71          com.liferay.portal.service.ServiceContext serviceContext)
72          throws com.liferay.portal.kernel.exception.PortalException,
73              com.liferay.portal.kernel.exception.SystemException {
74          try {
75              Object paramObj0 = new LongWrapper(groupId);
76  
77              Object paramObj1 = new LongWrapper(folderId);
78  
79              Object paramObj2 = name;
80  
81              if (name == null) {
82                  paramObj2 = new NullWrapper("java.lang.String");
83              }
84  
85              Object paramObj3 = title;
86  
87              if (title == null) {
88                  paramObj3 = new NullWrapper("java.lang.String");
89              }
90  
91              Object paramObj4 = description;
92  
93              if (description == null) {
94                  paramObj4 = new NullWrapper("java.lang.String");
95              }
96  
97              Object paramObj5 = versionDescription;
98  
99              if (versionDescription == null) {
100                 paramObj5 = new NullWrapper("java.lang.String");
101             }
102 
103             Object paramObj6 = extraSettings;
104 
105             if (extraSettings == null) {
106                 paramObj6 = new NullWrapper("java.lang.String");
107             }
108 
109             Object paramObj7 = bytes;
110 
111             if (bytes == null) {
112                 paramObj7 = new NullWrapper("[B");
113             }
114 
115             Object paramObj8 = serviceContext;
116 
117             if (serviceContext == null) {
118                 paramObj8 = new NullWrapper(
119                         "com.liferay.portal.service.ServiceContext");
120             }
121 
122             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
123                     "addFileEntry",
124                     new Object[] {
125                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
126                         paramObj5, paramObj6, paramObj7, paramObj8
127                     });
128 
129             Object returnObj = null;
130 
131             try {
132                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
133             }
134             catch (Exception e) {
135                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
136                     throw (com.liferay.portal.kernel.exception.PortalException)e;
137                 }
138 
139                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
140                     throw (com.liferay.portal.kernel.exception.SystemException)e;
141                 }
142 
143                 throw new com.liferay.portal.kernel.exception.SystemException(e);
144             }
145 
146             return (com.liferay.portlet.documentlibrary.model.DLFileEntry)returnObj;
147         }
148         catch (com.liferay.portal.kernel.exception.SystemException se) {
149             _log.error(se, se);
150 
151             throw se;
152         }
153     }
154 
155     public static com.liferay.portlet.documentlibrary.model.DLFileEntry addFileEntry(
156         HttpPrincipal httpPrincipal, long groupId, long folderId,
157         java.lang.String name, java.lang.String title,
158         java.lang.String description, java.lang.String versionDescription,
159         java.lang.String extraSettings, java.io.File file,
160         com.liferay.portal.service.ServiceContext serviceContext)
161         throws com.liferay.portal.kernel.exception.PortalException,
162             com.liferay.portal.kernel.exception.SystemException {
163         try {
164             Object paramObj0 = new LongWrapper(groupId);
165 
166             Object paramObj1 = new LongWrapper(folderId);
167 
168             Object paramObj2 = name;
169 
170             if (name == null) {
171                 paramObj2 = new NullWrapper("java.lang.String");
172             }
173 
174             Object paramObj3 = title;
175 
176             if (title == null) {
177                 paramObj3 = new NullWrapper("java.lang.String");
178             }
179 
180             Object paramObj4 = description;
181 
182             if (description == null) {
183                 paramObj4 = new NullWrapper("java.lang.String");
184             }
185 
186             Object paramObj5 = versionDescription;
187 
188             if (versionDescription == null) {
189                 paramObj5 = new NullWrapper("java.lang.String");
190             }
191 
192             Object paramObj6 = extraSettings;
193 
194             if (extraSettings == null) {
195                 paramObj6 = new NullWrapper("java.lang.String");
196             }
197 
198             Object paramObj7 = file;
199 
200             if (file == null) {
201                 paramObj7 = new NullWrapper("java.io.File");
202             }
203 
204             Object paramObj8 = serviceContext;
205 
206             if (serviceContext == null) {
207                 paramObj8 = new NullWrapper(
208                         "com.liferay.portal.service.ServiceContext");
209             }
210 
211             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
212                     "addFileEntry",
213                     new Object[] {
214                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
215                         paramObj5, paramObj6, paramObj7, paramObj8
216                     });
217 
218             Object returnObj = null;
219 
220             try {
221                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
222             }
223             catch (Exception e) {
224                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
225                     throw (com.liferay.portal.kernel.exception.PortalException)e;
226                 }
227 
228                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
229                     throw (com.liferay.portal.kernel.exception.SystemException)e;
230                 }
231 
232                 throw new com.liferay.portal.kernel.exception.SystemException(e);
233             }
234 
235             return (com.liferay.portlet.documentlibrary.model.DLFileEntry)returnObj;
236         }
237         catch (com.liferay.portal.kernel.exception.SystemException se) {
238             _log.error(se, se);
239 
240             throw se;
241         }
242     }
243 
244     public static void deleteFileEntry(HttpPrincipal httpPrincipal,
245         long groupId, long folderId, java.lang.String name)
246         throws com.liferay.portal.kernel.exception.PortalException,
247             com.liferay.portal.kernel.exception.SystemException {
248         try {
249             Object paramObj0 = new LongWrapper(groupId);
250 
251             Object paramObj1 = new LongWrapper(folderId);
252 
253             Object paramObj2 = name;
254 
255             if (name == null) {
256                 paramObj2 = new NullWrapper("java.lang.String");
257             }
258 
259             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
260                     "deleteFileEntry",
261                     new Object[] { paramObj0, paramObj1, paramObj2 });
262 
263             try {
264                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
265             }
266             catch (Exception e) {
267                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
268                     throw (com.liferay.portal.kernel.exception.PortalException)e;
269                 }
270 
271                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
272                     throw (com.liferay.portal.kernel.exception.SystemException)e;
273                 }
274 
275                 throw new com.liferay.portal.kernel.exception.SystemException(e);
276             }
277         }
278         catch (com.liferay.portal.kernel.exception.SystemException se) {
279             _log.error(se, se);
280 
281             throw se;
282         }
283     }
284 
285     public static void deleteFileEntry(HttpPrincipal httpPrincipal,
286         long groupId, long folderId, java.lang.String name,
287         java.lang.String version)
288         throws com.liferay.portal.kernel.exception.PortalException,
289             com.liferay.portal.kernel.exception.SystemException {
290         try {
291             Object paramObj0 = new LongWrapper(groupId);
292 
293             Object paramObj1 = new LongWrapper(folderId);
294 
295             Object paramObj2 = name;
296 
297             if (name == null) {
298                 paramObj2 = new NullWrapper("java.lang.String");
299             }
300 
301             Object paramObj3 = version;
302 
303             if (version == null) {
304                 paramObj3 = new NullWrapper("java.lang.String");
305             }
306 
307             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
308                     "deleteFileEntry",
309                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
310 
311             try {
312                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
313             }
314             catch (Exception e) {
315                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
316                     throw (com.liferay.portal.kernel.exception.PortalException)e;
317                 }
318 
319                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
320                     throw (com.liferay.portal.kernel.exception.SystemException)e;
321                 }
322 
323                 throw new com.liferay.portal.kernel.exception.SystemException(e);
324             }
325         }
326         catch (com.liferay.portal.kernel.exception.SystemException se) {
327             _log.error(se, se);
328 
329             throw se;
330         }
331     }
332 
333     public static void deleteFileEntryByTitle(HttpPrincipal httpPrincipal,
334         long groupId, long folderId, java.lang.String titleWithExtension)
335         throws com.liferay.portal.kernel.exception.PortalException,
336             com.liferay.portal.kernel.exception.SystemException {
337         try {
338             Object paramObj0 = new LongWrapper(groupId);
339 
340             Object paramObj1 = new LongWrapper(folderId);
341 
342             Object paramObj2 = titleWithExtension;
343 
344             if (titleWithExtension == null) {
345                 paramObj2 = new NullWrapper("java.lang.String");
346             }
347 
348             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
349                     "deleteFileEntryByTitle",
350                     new Object[] { paramObj0, paramObj1, paramObj2 });
351 
352             try {
353                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
354             }
355             catch (Exception e) {
356                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
357                     throw (com.liferay.portal.kernel.exception.PortalException)e;
358                 }
359 
360                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
361                     throw (com.liferay.portal.kernel.exception.SystemException)e;
362                 }
363 
364                 throw new com.liferay.portal.kernel.exception.SystemException(e);
365             }
366         }
367         catch (com.liferay.portal.kernel.exception.SystemException se) {
368             _log.error(se, se);
369 
370             throw se;
371         }
372     }
373 
374     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
375         HttpPrincipal httpPrincipal, long groupId, long folderId)
376         throws com.liferay.portal.kernel.exception.PortalException,
377             com.liferay.portal.kernel.exception.SystemException {
378         try {
379             Object paramObj0 = new LongWrapper(groupId);
380 
381             Object paramObj1 = new LongWrapper(folderId);
382 
383             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
384                     "getFileEntries", new Object[] { paramObj0, paramObj1 });
385 
386             Object returnObj = null;
387 
388             try {
389                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
390             }
391             catch (Exception e) {
392                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
393                     throw (com.liferay.portal.kernel.exception.PortalException)e;
394                 }
395 
396                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
397                     throw (com.liferay.portal.kernel.exception.SystemException)e;
398                 }
399 
400                 throw new com.liferay.portal.kernel.exception.SystemException(e);
401             }
402 
403             return (java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry>)returnObj;
404         }
405         catch (com.liferay.portal.kernel.exception.SystemException se) {
406             _log.error(se, se);
407 
408             throw se;
409         }
410     }
411 
412     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
413         HttpPrincipal httpPrincipal, long groupId, long folderId,
414         java.lang.String name)
415         throws com.liferay.portal.kernel.exception.PortalException,
416             com.liferay.portal.kernel.exception.SystemException {
417         try {
418             Object paramObj0 = new LongWrapper(groupId);
419 
420             Object paramObj1 = new LongWrapper(folderId);
421 
422             Object paramObj2 = name;
423 
424             if (name == null) {
425                 paramObj2 = new NullWrapper("java.lang.String");
426             }
427 
428             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
429                     "getFileEntry",
430                     new Object[] { paramObj0, paramObj1, paramObj2 });
431 
432             Object returnObj = null;
433 
434             try {
435                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
436             }
437             catch (Exception e) {
438                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
439                     throw (com.liferay.portal.kernel.exception.PortalException)e;
440                 }
441 
442                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
443                     throw (com.liferay.portal.kernel.exception.SystemException)e;
444                 }
445 
446                 throw new com.liferay.portal.kernel.exception.SystemException(e);
447             }
448 
449             return (com.liferay.portlet.documentlibrary.model.DLFileEntry)returnObj;
450         }
451         catch (com.liferay.portal.kernel.exception.SystemException se) {
452             _log.error(se, se);
453 
454             throw se;
455         }
456     }
457 
458     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
459         HttpPrincipal httpPrincipal, long groupId, long folderId,
460         java.lang.String titleWithExtension)
461         throws com.liferay.portal.kernel.exception.PortalException,
462             com.liferay.portal.kernel.exception.SystemException {
463         try {
464             Object paramObj0 = new LongWrapper(groupId);
465 
466             Object paramObj1 = new LongWrapper(folderId);
467 
468             Object paramObj2 = titleWithExtension;
469 
470             if (titleWithExtension == null) {
471                 paramObj2 = new NullWrapper("java.lang.String");
472             }
473 
474             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
475                     "getFileEntryByTitle",
476                     new Object[] { paramObj0, paramObj1, paramObj2 });
477 
478             Object returnObj = null;
479 
480             try {
481                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
482             }
483             catch (Exception e) {
484                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
485                     throw (com.liferay.portal.kernel.exception.PortalException)e;
486                 }
487 
488                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
489                     throw (com.liferay.portal.kernel.exception.SystemException)e;
490                 }
491 
492                 throw new com.liferay.portal.kernel.exception.SystemException(e);
493             }
494 
495             return (com.liferay.portlet.documentlibrary.model.DLFileEntry)returnObj;
496         }
497         catch (com.liferay.portal.kernel.exception.SystemException se) {
498             _log.error(se, se);
499 
500             throw se;
501         }
502     }
503 
504     public static boolean hasFileEntryLock(HttpPrincipal httpPrincipal,
505         long groupId, long folderId, java.lang.String name)
506         throws com.liferay.portal.kernel.exception.PortalException,
507             com.liferay.portal.kernel.exception.SystemException {
508         try {
509             Object paramObj0 = new LongWrapper(groupId);
510 
511             Object paramObj1 = new LongWrapper(folderId);
512 
513             Object paramObj2 = name;
514 
515             if (name == null) {
516                 paramObj2 = new NullWrapper("java.lang.String");
517             }
518 
519             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
520                     "hasFileEntryLock",
521                     new Object[] { paramObj0, paramObj1, paramObj2 });
522 
523             Object returnObj = null;
524 
525             try {
526                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
527             }
528             catch (Exception e) {
529                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
530                     throw (com.liferay.portal.kernel.exception.PortalException)e;
531                 }
532 
533                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
534                     throw (com.liferay.portal.kernel.exception.SystemException)e;
535                 }
536 
537                 throw new com.liferay.portal.kernel.exception.SystemException(e);
538             }
539 
540             return ((Boolean)returnObj).booleanValue();
541         }
542         catch (com.liferay.portal.kernel.exception.SystemException se) {
543             _log.error(se, se);
544 
545             throw se;
546         }
547     }
548 
549     public static com.liferay.portal.model.Lock lockFileEntry(
550         HttpPrincipal httpPrincipal, long groupId, long folderId,
551         java.lang.String name)
552         throws com.liferay.portal.kernel.exception.PortalException,
553             com.liferay.portal.kernel.exception.SystemException {
554         try {
555             Object paramObj0 = new LongWrapper(groupId);
556 
557             Object paramObj1 = new LongWrapper(folderId);
558 
559             Object paramObj2 = name;
560 
561             if (name == null) {
562                 paramObj2 = new NullWrapper("java.lang.String");
563             }
564 
565             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
566                     "lockFileEntry",
567                     new Object[] { paramObj0, paramObj1, paramObj2 });
568 
569             Object returnObj = null;
570 
571             try {
572                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
573             }
574             catch (Exception e) {
575                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
576                     throw (com.liferay.portal.kernel.exception.PortalException)e;
577                 }
578 
579                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
580                     throw (com.liferay.portal.kernel.exception.SystemException)e;
581                 }
582 
583                 throw new com.liferay.portal.kernel.exception.SystemException(e);
584             }
585 
586             return (com.liferay.portal.model.Lock)returnObj;
587         }
588         catch (com.liferay.portal.kernel.exception.SystemException se) {
589             _log.error(se, se);
590 
591             throw se;
592         }
593     }
594 
595     public static com.liferay.portal.model.Lock lockFileEntry(
596         HttpPrincipal httpPrincipal, long groupId, long folderId,
597         java.lang.String name, java.lang.String owner, long expirationTime)
598         throws com.liferay.portal.kernel.exception.PortalException,
599             com.liferay.portal.kernel.exception.SystemException {
600         try {
601             Object paramObj0 = new LongWrapper(groupId);
602 
603             Object paramObj1 = new LongWrapper(folderId);
604 
605             Object paramObj2 = name;
606 
607             if (name == null) {
608                 paramObj2 = new NullWrapper("java.lang.String");
609             }
610 
611             Object paramObj3 = owner;
612 
613             if (owner == null) {
614                 paramObj3 = new NullWrapper("java.lang.String");
615             }
616 
617             Object paramObj4 = new LongWrapper(expirationTime);
618 
619             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
620                     "lockFileEntry",
621                     new Object[] {
622                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
623                     });
624 
625             Object returnObj = null;
626 
627             try {
628                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
629             }
630             catch (Exception e) {
631                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
632                     throw (com.liferay.portal.kernel.exception.PortalException)e;
633                 }
634 
635                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
636                     throw (com.liferay.portal.kernel.exception.SystemException)e;
637                 }
638 
639                 throw new com.liferay.portal.kernel.exception.SystemException(e);
640             }
641 
642             return (com.liferay.portal.model.Lock)returnObj;
643         }
644         catch (com.liferay.portal.kernel.exception.SystemException se) {
645             _log.error(se, se);
646 
647             throw se;
648         }
649     }
650 
651     public static com.liferay.portal.model.Lock refreshFileEntryLock(
652         HttpPrincipal httpPrincipal, java.lang.String lockUuid,
653         long expirationTime)
654         throws com.liferay.portal.kernel.exception.PortalException,
655             com.liferay.portal.kernel.exception.SystemException {
656         try {
657             Object paramObj0 = lockUuid;
658 
659             if (lockUuid == null) {
660                 paramObj0 = new NullWrapper("java.lang.String");
661             }
662 
663             Object paramObj1 = new LongWrapper(expirationTime);
664 
665             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
666                     "refreshFileEntryLock",
667                     new Object[] { paramObj0, paramObj1 });
668 
669             Object returnObj = null;
670 
671             try {
672                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
673             }
674             catch (Exception e) {
675                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
676                     throw (com.liferay.portal.kernel.exception.PortalException)e;
677                 }
678 
679                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
680                     throw (com.liferay.portal.kernel.exception.SystemException)e;
681                 }
682 
683                 throw new com.liferay.portal.kernel.exception.SystemException(e);
684             }
685 
686             return (com.liferay.portal.model.Lock)returnObj;
687         }
688         catch (com.liferay.portal.kernel.exception.SystemException se) {
689             _log.error(se, se);
690 
691             throw se;
692         }
693     }
694 
695     public static void unlockFileEntry(HttpPrincipal httpPrincipal,
696         long groupId, long folderId, java.lang.String name)
697         throws com.liferay.portal.kernel.exception.SystemException {
698         try {
699             Object paramObj0 = new LongWrapper(groupId);
700 
701             Object paramObj1 = new LongWrapper(folderId);
702 
703             Object paramObj2 = name;
704 
705             if (name == null) {
706                 paramObj2 = new NullWrapper("java.lang.String");
707             }
708 
709             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
710                     "unlockFileEntry",
711                     new Object[] { paramObj0, paramObj1, paramObj2 });
712 
713             try {
714                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
715             }
716             catch (Exception e) {
717                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
718                     throw (com.liferay.portal.kernel.exception.SystemException)e;
719                 }
720 
721                 throw new com.liferay.portal.kernel.exception.SystemException(e);
722             }
723         }
724         catch (com.liferay.portal.kernel.exception.SystemException se) {
725             _log.error(se, se);
726 
727             throw se;
728         }
729     }
730 
731     public static void unlockFileEntry(HttpPrincipal httpPrincipal,
732         long groupId, long folderId, java.lang.String name,
733         java.lang.String lockUuid)
734         throws com.liferay.portal.kernel.exception.PortalException,
735             com.liferay.portal.kernel.exception.SystemException {
736         try {
737             Object paramObj0 = new LongWrapper(groupId);
738 
739             Object paramObj1 = new LongWrapper(folderId);
740 
741             Object paramObj2 = name;
742 
743             if (name == null) {
744                 paramObj2 = new NullWrapper("java.lang.String");
745             }
746 
747             Object paramObj3 = lockUuid;
748 
749             if (lockUuid == null) {
750                 paramObj3 = new NullWrapper("java.lang.String");
751             }
752 
753             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
754                     "unlockFileEntry",
755                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
756 
757             try {
758                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
759             }
760             catch (Exception e) {
761                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
762                     throw (com.liferay.portal.kernel.exception.PortalException)e;
763                 }
764 
765                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
766                     throw (com.liferay.portal.kernel.exception.SystemException)e;
767                 }
768 
769                 throw new com.liferay.portal.kernel.exception.SystemException(e);
770             }
771         }
772         catch (com.liferay.portal.kernel.exception.SystemException se) {
773             _log.error(se, se);
774 
775             throw se;
776         }
777     }
778 
779     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
780         HttpPrincipal httpPrincipal, long groupId, long folderId,
781         long newFolderId, java.lang.String name,
782         java.lang.String sourceFileName, java.lang.String title,
783         java.lang.String description, java.lang.String versionDescription,
784         boolean majorVersion, java.lang.String extraSettings, byte[] bytes,
785         com.liferay.portal.service.ServiceContext serviceContext)
786         throws com.liferay.portal.kernel.exception.PortalException,
787             com.liferay.portal.kernel.exception.SystemException {
788         try {
789             Object paramObj0 = new LongWrapper(groupId);
790 
791             Object paramObj1 = new LongWrapper(folderId);
792 
793             Object paramObj2 = new LongWrapper(newFolderId);
794 
795             Object paramObj3 = name;
796 
797             if (name == null) {
798                 paramObj3 = new NullWrapper("java.lang.String");
799             }
800 
801             Object paramObj4 = sourceFileName;
802 
803             if (sourceFileName == null) {
804                 paramObj4 = new NullWrapper("java.lang.String");
805             }
806 
807             Object paramObj5 = title;
808 
809             if (title == null) {
810                 paramObj5 = new NullWrapper("java.lang.String");
811             }
812 
813             Object paramObj6 = description;
814 
815             if (description == null) {
816                 paramObj6 = new NullWrapper("java.lang.String");
817             }
818 
819             Object paramObj7 = versionDescription;
820 
821             if (versionDescription == null) {
822                 paramObj7 = new NullWrapper("java.lang.String");
823             }
824 
825             Object paramObj8 = new BooleanWrapper(majorVersion);
826 
827             Object paramObj9 = extraSettings;
828 
829             if (extraSettings == null) {
830                 paramObj9 = new NullWrapper("java.lang.String");
831             }
832 
833             Object paramObj10 = bytes;
834 
835             if (bytes == null) {
836                 paramObj10 = new NullWrapper("[B");
837             }
838 
839             Object paramObj11 = serviceContext;
840 
841             if (serviceContext == null) {
842                 paramObj11 = new NullWrapper(
843                         "com.liferay.portal.service.ServiceContext");
844             }
845 
846             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
847                     "updateFileEntry",
848                     new Object[] {
849                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
850                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
851                         paramObj10, paramObj11
852                     });
853 
854             Object returnObj = null;
855 
856             try {
857                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
858             }
859             catch (Exception e) {
860                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
861                     throw (com.liferay.portal.kernel.exception.PortalException)e;
862                 }
863 
864                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
865                     throw (com.liferay.portal.kernel.exception.SystemException)e;
866                 }
867 
868                 throw new com.liferay.portal.kernel.exception.SystemException(e);
869             }
870 
871             return (com.liferay.portlet.documentlibrary.model.DLFileEntry)returnObj;
872         }
873         catch (com.liferay.portal.kernel.exception.SystemException se) {
874             _log.error(se, se);
875 
876             throw se;
877         }
878     }
879 
880     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
881         HttpPrincipal httpPrincipal, long groupId, long folderId,
882         long newFolderId, java.lang.String name,
883         java.lang.String sourceFileName, java.lang.String title,
884         java.lang.String description, java.lang.String versionDescription,
885         boolean majorVersion, java.lang.String extraSettings,
886         java.io.File file,
887         com.liferay.portal.service.ServiceContext serviceContext)
888         throws com.liferay.portal.kernel.exception.PortalException,
889             com.liferay.portal.kernel.exception.SystemException {
890         try {
891             Object paramObj0 = new LongWrapper(groupId);
892 
893             Object paramObj1 = new LongWrapper(folderId);
894 
895             Object paramObj2 = new LongWrapper(newFolderId);
896 
897             Object paramObj3 = name;
898 
899             if (name == null) {
900                 paramObj3 = new NullWrapper("java.lang.String");
901             }
902 
903             Object paramObj4 = sourceFileName;
904 
905             if (sourceFileName == null) {
906                 paramObj4 = new NullWrapper("java.lang.String");
907             }
908 
909             Object paramObj5 = title;
910 
911             if (title == null) {
912                 paramObj5 = new NullWrapper("java.lang.String");
913             }
914 
915             Object paramObj6 = description;
916 
917             if (description == null) {
918                 paramObj6 = new NullWrapper("java.lang.String");
919             }
920 
921             Object paramObj7 = versionDescription;
922 
923             if (versionDescription == null) {
924                 paramObj7 = new NullWrapper("java.lang.String");
925             }
926 
927             Object paramObj8 = new BooleanWrapper(majorVersion);
928 
929             Object paramObj9 = extraSettings;
930 
931             if (extraSettings == null) {
932                 paramObj9 = new NullWrapper("java.lang.String");
933             }
934 
935             Object paramObj10 = file;
936 
937             if (file == null) {
938                 paramObj10 = new NullWrapper("java.io.File");
939             }
940 
941             Object paramObj11 = serviceContext;
942 
943             if (serviceContext == null) {
944                 paramObj11 = new NullWrapper(
945                         "com.liferay.portal.service.ServiceContext");
946             }
947 
948             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
949                     "updateFileEntry",
950                     new Object[] {
951                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
952                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
953                         paramObj10, paramObj11
954                     });
955 
956             Object returnObj = null;
957 
958             try {
959                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
960             }
961             catch (Exception e) {
962                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
963                     throw (com.liferay.portal.kernel.exception.PortalException)e;
964                 }
965 
966                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
967                     throw (com.liferay.portal.kernel.exception.SystemException)e;
968                 }
969 
970                 throw new com.liferay.portal.kernel.exception.SystemException(e);
971             }
972 
973             return (com.liferay.portlet.documentlibrary.model.DLFileEntry)returnObj;
974         }
975         catch (com.liferay.portal.kernel.exception.SystemException se) {
976             _log.error(se, se);
977 
978             throw se;
979         }
980     }
981 
982     public static boolean verifyFileEntryLock(HttpPrincipal httpPrincipal,
983         long groupId, long folderId, java.lang.String name,
984         java.lang.String lockUuid)
985         throws com.liferay.portal.kernel.exception.PortalException,
986             com.liferay.portal.kernel.exception.SystemException {
987         try {
988             Object paramObj0 = new LongWrapper(groupId);
989 
990             Object paramObj1 = new LongWrapper(folderId);
991 
992             Object paramObj2 = name;
993 
994             if (name == null) {
995                 paramObj2 = new NullWrapper("java.lang.String");
996             }
997 
998             Object paramObj3 = lockUuid;
999 
1000            if (lockUuid == null) {
1001                paramObj3 = new NullWrapper("java.lang.String");
1002            }
1003
1004            MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
1005                    "verifyFileEntryLock",
1006                    new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
1007
1008            Object returnObj = null;
1009
1010            try {
1011                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1012            }
1013            catch (Exception e) {
1014                if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
1015                    throw (com.liferay.portal.kernel.exception.PortalException)e;
1016                }
1017
1018                if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
1019                    throw (com.liferay.portal.kernel.exception.SystemException)e;
1020                }
1021
1022                throw new com.liferay.portal.kernel.exception.SystemException(e);
1023            }
1024
1025            return ((Boolean)returnObj).booleanValue();
1026        }
1027        catch (com.liferay.portal.kernel.exception.SystemException se) {
1028            _log.error(se, se);
1029
1030            throw se;
1031        }
1032    }
1033
1034    private static Log _log = LogFactoryUtil.getLog(DLFileEntryServiceHttp.class);
1035}