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