1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.documentlibrary.service.http;
24  
25  import com.liferay.portal.kernel.log.Log;
26  import com.liferay.portal.kernel.log.LogFactoryUtil;
27  import com.liferay.portal.kernel.util.BooleanWrapper;
28  import com.liferay.portal.kernel.util.LongWrapper;
29  import com.liferay.portal.kernel.util.MethodWrapper;
30  import com.liferay.portal.kernel.util.NullWrapper;
31  import com.liferay.portal.security.auth.HttpPrincipal;
32  import com.liferay.portal.service.http.TunnelUtil;
33  
34  import com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil;
35  
36  /**
37   * <a href="DLFolderServiceHttp.java.html"><b><i>View Source</i></b></a>
38   *
39   * <p>
40   * ServiceBuilder generated this class. Modifications in this class will be
41   * overwritten the next time is generated.
42   * </p>
43   *
44   * <p>
45   * This class provides a HTTP utility for the
46   * <code>com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil</code> service
47   * utility. The static methods of this class calls the same methods of the
48   * service utility. However, the signatures are different because it requires an
49   * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
50   * parameter.
51   * </p>
52   *
53   * <p>
54   * The benefits of using the HTTP utility is that it is fast and allows for
55   * tunneling without the cost of serializing to text. The drawback is that it
56   * only works with Java.
57   * </p>
58   *
59   * <p>
60   * Set the property <code>tunnel.servlet.hosts.allowed</code> in
61   * portal.properties to configure security.
62   * </p>
63   *
64   * <p>
65   * The HTTP utility is only generated for remote services.
66   * </p>
67   *
68   * @author Brian Wing Shun Chan
69   *
70   * @see com.liferay.portal.security.auth.HttpPrincipal
71   * @see com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil
72   * @see com.liferay.portlet.documentlibrary.service.http.DLFolderServiceSoap
73   *
74   */
75  public class DLFolderServiceHttp {
76      public static com.liferay.portlet.documentlibrary.model.DLFolder addFolder(
77          HttpPrincipal httpPrincipal, long groupId, long parentFolderId,
78          java.lang.String name, java.lang.String description,
79          com.liferay.portal.service.ServiceContext serviceContext)
80          throws com.liferay.portal.PortalException,
81              com.liferay.portal.SystemException {
82          try {
83              Object paramObj0 = new LongWrapper(groupId);
84  
85              Object paramObj1 = new LongWrapper(parentFolderId);
86  
87              Object paramObj2 = name;
88  
89              if (name == null) {
90                  paramObj2 = new NullWrapper("java.lang.String");
91              }
92  
93              Object paramObj3 = description;
94  
95              if (description == null) {
96                  paramObj3 = new NullWrapper("java.lang.String");
97              }
98  
99              Object paramObj4 = serviceContext;
100 
101             if (serviceContext == null) {
102                 paramObj4 = new NullWrapper(
103                         "com.liferay.portal.service.ServiceContext");
104             }
105 
106             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
107                     "addFolder",
108                     new Object[] {
109                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
110                     });
111 
112             Object returnObj = null;
113 
114             try {
115                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
116             }
117             catch (Exception e) {
118                 if (e instanceof com.liferay.portal.PortalException) {
119                     throw (com.liferay.portal.PortalException)e;
120                 }
121 
122                 if (e instanceof com.liferay.portal.SystemException) {
123                     throw (com.liferay.portal.SystemException)e;
124                 }
125 
126                 throw new com.liferay.portal.SystemException(e);
127             }
128 
129             return (com.liferay.portlet.documentlibrary.model.DLFolder)returnObj;
130         }
131         catch (com.liferay.portal.SystemException se) {
132             _log.error(se, se);
133 
134             throw se;
135         }
136     }
137 
138     public static com.liferay.portlet.documentlibrary.model.DLFolder copyFolder(
139         HttpPrincipal httpPrincipal, long groupId, long sourceFolderId,
140         long parentFolderId, java.lang.String name,
141         java.lang.String description,
142         com.liferay.portal.service.ServiceContext serviceContext)
143         throws com.liferay.portal.PortalException,
144             com.liferay.portal.SystemException, java.rmi.RemoteException {
145         try {
146             Object paramObj0 = new LongWrapper(groupId);
147 
148             Object paramObj1 = new LongWrapper(sourceFolderId);
149 
150             Object paramObj2 = new LongWrapper(parentFolderId);
151 
152             Object paramObj3 = name;
153 
154             if (name == null) {
155                 paramObj3 = new NullWrapper("java.lang.String");
156             }
157 
158             Object paramObj4 = description;
159 
160             if (description == null) {
161                 paramObj4 = new NullWrapper("java.lang.String");
162             }
163 
164             Object paramObj5 = serviceContext;
165 
166             if (serviceContext == null) {
167                 paramObj5 = new NullWrapper(
168                         "com.liferay.portal.service.ServiceContext");
169             }
170 
171             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
172                     "copyFolder",
173                     new Object[] {
174                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
175                         paramObj5
176                     });
177 
178             Object returnObj = null;
179 
180             try {
181                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
182             }
183             catch (Exception e) {
184                 if (e instanceof com.liferay.portal.PortalException) {
185                     throw (com.liferay.portal.PortalException)e;
186                 }
187 
188                 if (e instanceof com.liferay.portal.SystemException) {
189                     throw (com.liferay.portal.SystemException)e;
190                 }
191 
192                 if (e instanceof java.rmi.RemoteException) {
193                     throw (java.rmi.RemoteException)e;
194                 }
195 
196                 throw new com.liferay.portal.SystemException(e);
197             }
198 
199             return (com.liferay.portlet.documentlibrary.model.DLFolder)returnObj;
200         }
201         catch (com.liferay.portal.SystemException se) {
202             _log.error(se, se);
203 
204             throw se;
205         }
206     }
207 
208     public static void deleteFolder(HttpPrincipal httpPrincipal, long folderId)
209         throws com.liferay.portal.PortalException,
210             com.liferay.portal.SystemException, java.rmi.RemoteException {
211         try {
212             Object paramObj0 = new LongWrapper(folderId);
213 
214             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
215                     "deleteFolder", new Object[] { paramObj0 });
216 
217             try {
218                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
219             }
220             catch (Exception e) {
221                 if (e instanceof com.liferay.portal.PortalException) {
222                     throw (com.liferay.portal.PortalException)e;
223                 }
224 
225                 if (e instanceof com.liferay.portal.SystemException) {
226                     throw (com.liferay.portal.SystemException)e;
227                 }
228 
229                 if (e instanceof java.rmi.RemoteException) {
230                     throw (java.rmi.RemoteException)e;
231                 }
232 
233                 throw new com.liferay.portal.SystemException(e);
234             }
235         }
236         catch (com.liferay.portal.SystemException se) {
237             _log.error(se, se);
238 
239             throw se;
240         }
241     }
242 
243     public static void deleteFolder(HttpPrincipal httpPrincipal, long groupId,
244         long parentFolderId, java.lang.String name)
245         throws com.liferay.portal.PortalException,
246             com.liferay.portal.SystemException, java.rmi.RemoteException {
247         try {
248             Object paramObj0 = new LongWrapper(groupId);
249 
250             Object paramObj1 = new LongWrapper(parentFolderId);
251 
252             Object paramObj2 = name;
253 
254             if (name == null) {
255                 paramObj2 = new NullWrapper("java.lang.String");
256             }
257 
258             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
259                     "deleteFolder",
260                     new Object[] { paramObj0, paramObj1, paramObj2 });
261 
262             try {
263                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
264             }
265             catch (Exception e) {
266                 if (e instanceof com.liferay.portal.PortalException) {
267                     throw (com.liferay.portal.PortalException)e;
268                 }
269 
270                 if (e instanceof com.liferay.portal.SystemException) {
271                     throw (com.liferay.portal.SystemException)e;
272                 }
273 
274                 if (e instanceof java.rmi.RemoteException) {
275                     throw (java.rmi.RemoteException)e;
276                 }
277 
278                 throw new com.liferay.portal.SystemException(e);
279             }
280         }
281         catch (com.liferay.portal.SystemException se) {
282             _log.error(se, se);
283 
284             throw se;
285         }
286     }
287 
288     public static com.liferay.portlet.documentlibrary.model.DLFolder getFolder(
289         HttpPrincipal httpPrincipal, long folderId)
290         throws com.liferay.portal.PortalException,
291             com.liferay.portal.SystemException {
292         try {
293             Object paramObj0 = new LongWrapper(folderId);
294 
295             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
296                     "getFolder", new Object[] { paramObj0 });
297 
298             Object returnObj = null;
299 
300             try {
301                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
302             }
303             catch (Exception e) {
304                 if (e instanceof com.liferay.portal.PortalException) {
305                     throw (com.liferay.portal.PortalException)e;
306                 }
307 
308                 if (e instanceof com.liferay.portal.SystemException) {
309                     throw (com.liferay.portal.SystemException)e;
310                 }
311 
312                 throw new com.liferay.portal.SystemException(e);
313             }
314 
315             return (com.liferay.portlet.documentlibrary.model.DLFolder)returnObj;
316         }
317         catch (com.liferay.portal.SystemException se) {
318             _log.error(se, se);
319 
320             throw se;
321         }
322     }
323 
324     public static com.liferay.portlet.documentlibrary.model.DLFolder getFolder(
325         HttpPrincipal httpPrincipal, long groupId, long parentFolderId,
326         java.lang.String name)
327         throws com.liferay.portal.PortalException,
328             com.liferay.portal.SystemException {
329         try {
330             Object paramObj0 = new LongWrapper(groupId);
331 
332             Object paramObj1 = new LongWrapper(parentFolderId);
333 
334             Object paramObj2 = name;
335 
336             if (name == null) {
337                 paramObj2 = new NullWrapper("java.lang.String");
338             }
339 
340             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
341                     "getFolder",
342                     new Object[] { paramObj0, paramObj1, paramObj2 });
343 
344             Object returnObj = null;
345 
346             try {
347                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
348             }
349             catch (Exception e) {
350                 if (e instanceof com.liferay.portal.PortalException) {
351                     throw (com.liferay.portal.PortalException)e;
352                 }
353 
354                 if (e instanceof com.liferay.portal.SystemException) {
355                     throw (com.liferay.portal.SystemException)e;
356                 }
357 
358                 throw new com.liferay.portal.SystemException(e);
359             }
360 
361             return (com.liferay.portlet.documentlibrary.model.DLFolder)returnObj;
362         }
363         catch (com.liferay.portal.SystemException se) {
364             _log.error(se, se);
365 
366             throw se;
367         }
368     }
369 
370     public static long getFolderId(HttpPrincipal httpPrincipal, long groupId,
371         long parentFolderId, java.lang.String name)
372         throws com.liferay.portal.PortalException,
373             com.liferay.portal.SystemException {
374         try {
375             Object paramObj0 = new LongWrapper(groupId);
376 
377             Object paramObj1 = new LongWrapper(parentFolderId);
378 
379             Object paramObj2 = name;
380 
381             if (name == null) {
382                 paramObj2 = new NullWrapper("java.lang.String");
383             }
384 
385             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
386                     "getFolderId",
387                     new Object[] { paramObj0, paramObj1, paramObj2 });
388 
389             Object returnObj = null;
390 
391             try {
392                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
393             }
394             catch (Exception e) {
395                 if (e instanceof com.liferay.portal.PortalException) {
396                     throw (com.liferay.portal.PortalException)e;
397                 }
398 
399                 if (e instanceof com.liferay.portal.SystemException) {
400                     throw (com.liferay.portal.SystemException)e;
401                 }
402 
403                 throw new com.liferay.portal.SystemException(e);
404             }
405 
406             return ((Long)returnObj).longValue();
407         }
408         catch (com.liferay.portal.SystemException se) {
409             _log.error(se, se);
410 
411             throw se;
412         }
413     }
414 
415     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> getFolders(
416         HttpPrincipal httpPrincipal, long groupId, long parentFolderId)
417         throws com.liferay.portal.PortalException,
418             com.liferay.portal.SystemException {
419         try {
420             Object paramObj0 = new LongWrapper(groupId);
421 
422             Object paramObj1 = new LongWrapper(parentFolderId);
423 
424             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
425                     "getFolders", new Object[] { paramObj0, paramObj1 });
426 
427             Object returnObj = null;
428 
429             try {
430                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
431             }
432             catch (Exception e) {
433                 if (e instanceof com.liferay.portal.PortalException) {
434                     throw (com.liferay.portal.PortalException)e;
435                 }
436 
437                 if (e instanceof com.liferay.portal.SystemException) {
438                     throw (com.liferay.portal.SystemException)e;
439                 }
440 
441                 throw new com.liferay.portal.SystemException(e);
442             }
443 
444             return (java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder>)returnObj;
445         }
446         catch (com.liferay.portal.SystemException se) {
447             _log.error(se, se);
448 
449             throw se;
450         }
451     }
452 
453     public static boolean hasInheritableLock(HttpPrincipal httpPrincipal,
454         long folderId)
455         throws com.liferay.portal.SystemException,
456             com.liferay.portal.PortalException {
457         try {
458             Object paramObj0 = new LongWrapper(folderId);
459 
460             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
461                     "hasInheritableLock", new Object[] { paramObj0 });
462 
463             Object returnObj = null;
464 
465             try {
466                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
467             }
468             catch (Exception e) {
469                 if (e instanceof com.liferay.portal.PortalException) {
470                     throw (com.liferay.portal.PortalException)e;
471                 }
472 
473                 throw new com.liferay.portal.SystemException(e);
474             }
475 
476             return ((Boolean)returnObj).booleanValue();
477         }
478         catch (com.liferay.portal.SystemException se) {
479             _log.error(se, se);
480 
481             throw se;
482         }
483     }
484 
485     public static com.liferay.lock.model.Lock lockFolder(
486         HttpPrincipal httpPrincipal, long folderId)
487         throws com.liferay.portal.PortalException,
488             com.liferay.portal.SystemException, java.rmi.RemoteException {
489         try {
490             Object paramObj0 = new LongWrapper(folderId);
491 
492             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
493                     "lockFolder", new Object[] { paramObj0 });
494 
495             Object returnObj = null;
496 
497             try {
498                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
499             }
500             catch (Exception e) {
501                 if (e instanceof com.liferay.portal.PortalException) {
502                     throw (com.liferay.portal.PortalException)e;
503                 }
504 
505                 if (e instanceof com.liferay.portal.SystemException) {
506                     throw (com.liferay.portal.SystemException)e;
507                 }
508 
509                 if (e instanceof java.rmi.RemoteException) {
510                     throw (java.rmi.RemoteException)e;
511                 }
512 
513                 throw new com.liferay.portal.SystemException(e);
514             }
515 
516             return (com.liferay.lock.model.Lock)returnObj;
517         }
518         catch (com.liferay.portal.SystemException se) {
519             _log.error(se, se);
520 
521             throw se;
522         }
523     }
524 
525     public static com.liferay.lock.model.Lock lockFolder(
526         HttpPrincipal httpPrincipal, long folderId, java.lang.String owner,
527         boolean inheritable, long expirationTime)
528         throws com.liferay.portal.PortalException,
529             com.liferay.portal.SystemException, java.rmi.RemoteException {
530         try {
531             Object paramObj0 = new LongWrapper(folderId);
532 
533             Object paramObj1 = owner;
534 
535             if (owner == null) {
536                 paramObj1 = new NullWrapper("java.lang.String");
537             }
538 
539             Object paramObj2 = new BooleanWrapper(inheritable);
540 
541             Object paramObj3 = new LongWrapper(expirationTime);
542 
543             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
544                     "lockFolder",
545                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
546 
547             Object returnObj = null;
548 
549             try {
550                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
551             }
552             catch (Exception e) {
553                 if (e instanceof com.liferay.portal.PortalException) {
554                     throw (com.liferay.portal.PortalException)e;
555                 }
556 
557                 if (e instanceof com.liferay.portal.SystemException) {
558                     throw (com.liferay.portal.SystemException)e;
559                 }
560 
561                 if (e instanceof java.rmi.RemoteException) {
562                     throw (java.rmi.RemoteException)e;
563                 }
564 
565                 throw new com.liferay.portal.SystemException(e);
566             }
567 
568             return (com.liferay.lock.model.Lock)returnObj;
569         }
570         catch (com.liferay.portal.SystemException se) {
571             _log.error(se, se);
572 
573             throw se;
574         }
575     }
576 
577     public static com.liferay.lock.model.Lock refreshFolderLock(
578         HttpPrincipal httpPrincipal, java.lang.String lockUuid,
579         long expirationTime)
580         throws com.liferay.portal.SystemException,
581             com.liferay.portal.PortalException {
582         try {
583             Object paramObj0 = lockUuid;
584 
585             if (lockUuid == null) {
586                 paramObj0 = new NullWrapper("java.lang.String");
587             }
588 
589             Object paramObj1 = new LongWrapper(expirationTime);
590 
591             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
592                     "refreshFolderLock", new Object[] { paramObj0, paramObj1 });
593 
594             Object returnObj = null;
595 
596             try {
597                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
598             }
599             catch (Exception e) {
600                 if (e instanceof com.liferay.portal.PortalException) {
601                     throw (com.liferay.portal.PortalException)e;
602                 }
603 
604                 throw new com.liferay.portal.SystemException(e);
605             }
606 
607             return (com.liferay.lock.model.Lock)returnObj;
608         }
609         catch (com.liferay.portal.SystemException se) {
610             _log.error(se, se);
611 
612             throw se;
613         }
614     }
615 
616     public static void reIndexSearch(HttpPrincipal httpPrincipal, long companyId)
617         throws com.liferay.portal.PortalException,
618             com.liferay.portal.SystemException {
619         try {
620             Object paramObj0 = new LongWrapper(companyId);
621 
622             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
623                     "reIndexSearch", new Object[] { paramObj0 });
624 
625             try {
626                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
627             }
628             catch (Exception e) {
629                 if (e instanceof com.liferay.portal.PortalException) {
630                     throw (com.liferay.portal.PortalException)e;
631                 }
632 
633                 if (e instanceof com.liferay.portal.SystemException) {
634                     throw (com.liferay.portal.SystemException)e;
635                 }
636 
637                 throw new com.liferay.portal.SystemException(e);
638             }
639         }
640         catch (com.liferay.portal.SystemException se) {
641             _log.error(se, se);
642 
643             throw se;
644         }
645     }
646 
647     public static void unlockFolder(HttpPrincipal httpPrincipal, long folderId,
648         java.lang.String lockUuid)
649         throws com.liferay.portal.SystemException,
650             com.liferay.portal.PortalException {
651         try {
652             Object paramObj0 = new LongWrapper(folderId);
653 
654             Object paramObj1 = lockUuid;
655 
656             if (lockUuid == null) {
657                 paramObj1 = new NullWrapper("java.lang.String");
658             }
659 
660             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
661                     "unlockFolder", new Object[] { paramObj0, paramObj1 });
662 
663             try {
664                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
665             }
666             catch (Exception e) {
667                 if (e instanceof com.liferay.portal.PortalException) {
668                     throw (com.liferay.portal.PortalException)e;
669                 }
670 
671                 throw new com.liferay.portal.SystemException(e);
672             }
673         }
674         catch (com.liferay.portal.SystemException se) {
675             _log.error(se, se);
676 
677             throw se;
678         }
679     }
680 
681     public static void unlockFolder(HttpPrincipal httpPrincipal, long groupId,
682         long parentFolderId, java.lang.String name, java.lang.String lockUuid)
683         throws com.liferay.portal.PortalException,
684             com.liferay.portal.SystemException {
685         try {
686             Object paramObj0 = new LongWrapper(groupId);
687 
688             Object paramObj1 = new LongWrapper(parentFolderId);
689 
690             Object paramObj2 = name;
691 
692             if (name == null) {
693                 paramObj2 = new NullWrapper("java.lang.String");
694             }
695 
696             Object paramObj3 = lockUuid;
697 
698             if (lockUuid == null) {
699                 paramObj3 = new NullWrapper("java.lang.String");
700             }
701 
702             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
703                     "unlockFolder",
704                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
705 
706             try {
707                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
708             }
709             catch (Exception e) {
710                 if (e instanceof com.liferay.portal.PortalException) {
711                     throw (com.liferay.portal.PortalException)e;
712                 }
713 
714                 if (e instanceof com.liferay.portal.SystemException) {
715                     throw (com.liferay.portal.SystemException)e;
716                 }
717 
718                 throw new com.liferay.portal.SystemException(e);
719             }
720         }
721         catch (com.liferay.portal.SystemException se) {
722             _log.error(se, se);
723 
724             throw se;
725         }
726     }
727 
728     public static com.liferay.portlet.documentlibrary.model.DLFolder updateFolder(
729         HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
730         java.lang.String name, java.lang.String description,
731         com.liferay.portal.service.ServiceContext serviceContext)
732         throws com.liferay.portal.PortalException,
733             com.liferay.portal.SystemException, java.rmi.RemoteException {
734         try {
735             Object paramObj0 = new LongWrapper(folderId);
736 
737             Object paramObj1 = new LongWrapper(parentFolderId);
738 
739             Object paramObj2 = name;
740 
741             if (name == null) {
742                 paramObj2 = new NullWrapper("java.lang.String");
743             }
744 
745             Object paramObj3 = description;
746 
747             if (description == null) {
748                 paramObj3 = new NullWrapper("java.lang.String");
749             }
750 
751             Object paramObj4 = serviceContext;
752 
753             if (serviceContext == null) {
754                 paramObj4 = new NullWrapper(
755                         "com.liferay.portal.service.ServiceContext");
756             }
757 
758             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
759                     "updateFolder",
760                     new Object[] {
761                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
762                     });
763 
764             Object returnObj = null;
765 
766             try {
767                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
768             }
769             catch (Exception e) {
770                 if (e instanceof com.liferay.portal.PortalException) {
771                     throw (com.liferay.portal.PortalException)e;
772                 }
773 
774                 if (e instanceof com.liferay.portal.SystemException) {
775                     throw (com.liferay.portal.SystemException)e;
776                 }
777 
778                 if (e instanceof java.rmi.RemoteException) {
779                     throw (java.rmi.RemoteException)e;
780                 }
781 
782                 throw new com.liferay.portal.SystemException(e);
783             }
784 
785             return (com.liferay.portlet.documentlibrary.model.DLFolder)returnObj;
786         }
787         catch (com.liferay.portal.SystemException se) {
788             _log.error(se, se);
789 
790             throw se;
791         }
792     }
793 
794     public static boolean verifyInheritableLock(HttpPrincipal httpPrincipal,
795         long folderId, java.lang.String lockUuid)
796         throws com.liferay.portal.SystemException,
797             com.liferay.portal.PortalException {
798         try {
799             Object paramObj0 = new LongWrapper(folderId);
800 
801             Object paramObj1 = lockUuid;
802 
803             if (lockUuid == null) {
804                 paramObj1 = new NullWrapper("java.lang.String");
805             }
806 
807             MethodWrapper methodWrapper = new MethodWrapper(DLFolderServiceUtil.class.getName(),
808                     "verifyInheritableLock",
809                     new Object[] { paramObj0, paramObj1 });
810 
811             Object returnObj = null;
812 
813             try {
814                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
815             }
816             catch (Exception e) {
817                 if (e instanceof com.liferay.portal.PortalException) {
818                     throw (com.liferay.portal.PortalException)e;
819                 }
820 
821                 throw new com.liferay.portal.SystemException(e);
822             }
823 
824             return ((Boolean)returnObj).booleanValue();
825         }
826         catch (com.liferay.portal.SystemException se) {
827             _log.error(se, se);
828 
829             throw se;
830         }
831     }
832 
833     private static Log _log = LogFactoryUtil.getLog(DLFolderServiceHttp.class);
834 }