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.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 {
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                 throw new com.liferay.portal.SystemException(e);
458             }
459         }
460         catch (com.liferay.portal.SystemException se) {
461             _log.error(se, se);
462 
463             throw se;
464         }
465     }
466 
467     public static void deleteFileEntry(HttpPrincipal httpPrincipal,
468         long folderId, java.lang.String name, double version)
469         throws com.liferay.portal.PortalException,
470             com.liferay.portal.SystemException {
471         try {
472             Object paramObj0 = new LongWrapper(folderId);
473 
474             Object paramObj1 = name;
475 
476             if (name == null) {
477                 paramObj1 = new NullWrapper("java.lang.String");
478             }
479 
480             Object paramObj2 = new DoubleWrapper(version);
481 
482             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
483                     "deleteFileEntry",
484                     new Object[] { paramObj0, paramObj1, paramObj2 });
485 
486             try {
487                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
488             }
489             catch (Exception e) {
490                 if (e instanceof com.liferay.portal.PortalException) {
491                     throw (com.liferay.portal.PortalException)e;
492                 }
493 
494                 if (e instanceof com.liferay.portal.SystemException) {
495                     throw (com.liferay.portal.SystemException)e;
496                 }
497 
498                 throw new com.liferay.portal.SystemException(e);
499             }
500         }
501         catch (com.liferay.portal.SystemException se) {
502             _log.error(se, se);
503 
504             throw se;
505         }
506     }
507 
508     public static void deleteFileEntryByTitle(HttpPrincipal httpPrincipal,
509         long folderId, java.lang.String titleWithExtension)
510         throws com.liferay.portal.PortalException,
511             com.liferay.portal.SystemException {
512         try {
513             Object paramObj0 = new LongWrapper(folderId);
514 
515             Object paramObj1 = titleWithExtension;
516 
517             if (titleWithExtension == null) {
518                 paramObj1 = new NullWrapper("java.lang.String");
519             }
520 
521             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
522                     "deleteFileEntryByTitle",
523                     new Object[] { paramObj0, paramObj1 });
524 
525             try {
526                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
527             }
528             catch (Exception e) {
529                 if (e instanceof com.liferay.portal.PortalException) {
530                     throw (com.liferay.portal.PortalException)e;
531                 }
532 
533                 if (e instanceof com.liferay.portal.SystemException) {
534                     throw (com.liferay.portal.SystemException)e;
535                 }
536 
537                 throw new com.liferay.portal.SystemException(e);
538             }
539         }
540         catch (com.liferay.portal.SystemException se) {
541             _log.error(se, se);
542 
543             throw se;
544         }
545     }
546 
547     public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> getFileEntries(
548         HttpPrincipal httpPrincipal, long folderId)
549         throws com.liferay.portal.PortalException,
550             com.liferay.portal.SystemException {
551         try {
552             Object paramObj0 = new LongWrapper(folderId);
553 
554             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
555                     "getFileEntries", new Object[] { paramObj0 });
556 
557             Object returnObj = null;
558 
559             try {
560                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
561             }
562             catch (Exception e) {
563                 if (e instanceof com.liferay.portal.PortalException) {
564                     throw (com.liferay.portal.PortalException)e;
565                 }
566 
567                 if (e instanceof com.liferay.portal.SystemException) {
568                     throw (com.liferay.portal.SystemException)e;
569                 }
570 
571                 throw new com.liferay.portal.SystemException(e);
572             }
573 
574             return (java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry>)returnObj;
575         }
576         catch (com.liferay.portal.SystemException se) {
577             _log.error(se, se);
578 
579             throw se;
580         }
581     }
582 
583     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(
584         HttpPrincipal httpPrincipal, long folderId, java.lang.String name)
585         throws com.liferay.portal.PortalException,
586             com.liferay.portal.SystemException {
587         try {
588             Object paramObj0 = new LongWrapper(folderId);
589 
590             Object paramObj1 = name;
591 
592             if (name == null) {
593                 paramObj1 = new NullWrapper("java.lang.String");
594             }
595 
596             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
597                     "getFileEntry", new Object[] { paramObj0, paramObj1 });
598 
599             Object returnObj = null;
600 
601             try {
602                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
603             }
604             catch (Exception e) {
605                 if (e instanceof com.liferay.portal.PortalException) {
606                     throw (com.liferay.portal.PortalException)e;
607                 }
608 
609                 if (e instanceof com.liferay.portal.SystemException) {
610                     throw (com.liferay.portal.SystemException)e;
611                 }
612 
613                 throw new com.liferay.portal.SystemException(e);
614             }
615 
616             return (com.liferay.portlet.documentlibrary.model.DLFileEntry)returnObj;
617         }
618         catch (com.liferay.portal.SystemException se) {
619             _log.error(se, se);
620 
621             throw se;
622         }
623     }
624 
625     public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntryByTitle(
626         HttpPrincipal httpPrincipal, long folderId,
627         java.lang.String titleWithExtension)
628         throws com.liferay.portal.PortalException,
629             com.liferay.portal.SystemException {
630         try {
631             Object paramObj0 = new LongWrapper(folderId);
632 
633             Object paramObj1 = titleWithExtension;
634 
635             if (titleWithExtension == null) {
636                 paramObj1 = new NullWrapper("java.lang.String");
637             }
638 
639             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
640                     "getFileEntryByTitle", new Object[] { paramObj0, paramObj1 });
641 
642             Object returnObj = null;
643 
644             try {
645                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
646             }
647             catch (Exception e) {
648                 if (e instanceof com.liferay.portal.PortalException) {
649                     throw (com.liferay.portal.PortalException)e;
650                 }
651 
652                 if (e instanceof com.liferay.portal.SystemException) {
653                     throw (com.liferay.portal.SystemException)e;
654                 }
655 
656                 throw new com.liferay.portal.SystemException(e);
657             }
658 
659             return (com.liferay.portlet.documentlibrary.model.DLFileEntry)returnObj;
660         }
661         catch (com.liferay.portal.SystemException se) {
662             _log.error(se, se);
663 
664             throw se;
665         }
666     }
667 
668     public static boolean hasFileEntryLock(HttpPrincipal httpPrincipal,
669         long folderId, java.lang.String name)
670         throws com.liferay.portal.SystemException,
671             com.liferay.portal.PortalException {
672         try {
673             Object paramObj0 = new LongWrapper(folderId);
674 
675             Object paramObj1 = name;
676 
677             if (name == null) {
678                 paramObj1 = new NullWrapper("java.lang.String");
679             }
680 
681             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
682                     "hasFileEntryLock", new Object[] { paramObj0, paramObj1 });
683 
684             Object returnObj = null;
685 
686             try {
687                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
688             }
689             catch (Exception e) {
690                 if (e instanceof com.liferay.portal.PortalException) {
691                     throw (com.liferay.portal.PortalException)e;
692                 }
693 
694                 throw new com.liferay.portal.SystemException(e);
695             }
696 
697             return ((Boolean)returnObj).booleanValue();
698         }
699         catch (com.liferay.portal.SystemException se) {
700             _log.error(se, se);
701 
702             throw se;
703         }
704     }
705 
706     public static com.liferay.lock.model.Lock lockFileEntry(
707         HttpPrincipal httpPrincipal, long folderId, java.lang.String name)
708         throws com.liferay.portal.PortalException,
709             com.liferay.portal.SystemException {
710         try {
711             Object paramObj0 = new LongWrapper(folderId);
712 
713             Object paramObj1 = name;
714 
715             if (name == null) {
716                 paramObj1 = new NullWrapper("java.lang.String");
717             }
718 
719             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
720                     "lockFileEntry", new Object[] { paramObj0, paramObj1 });
721 
722             Object returnObj = null;
723 
724             try {
725                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
726             }
727             catch (Exception e) {
728                 if (e instanceof com.liferay.portal.PortalException) {
729                     throw (com.liferay.portal.PortalException)e;
730                 }
731 
732                 if (e instanceof com.liferay.portal.SystemException) {
733                     throw (com.liferay.portal.SystemException)e;
734                 }
735 
736                 throw new com.liferay.portal.SystemException(e);
737             }
738 
739             return (com.liferay.lock.model.Lock)returnObj;
740         }
741         catch (com.liferay.portal.SystemException se) {
742             _log.error(se, se);
743 
744             throw se;
745         }
746     }
747 
748     public static com.liferay.lock.model.Lock lockFileEntry(
749         HttpPrincipal httpPrincipal, long folderId, java.lang.String name,
750         java.lang.String owner, long expirationTime)
751         throws com.liferay.portal.PortalException,
752             com.liferay.portal.SystemException {
753         try {
754             Object paramObj0 = new LongWrapper(folderId);
755 
756             Object paramObj1 = name;
757 
758             if (name == null) {
759                 paramObj1 = new NullWrapper("java.lang.String");
760             }
761 
762             Object paramObj2 = owner;
763 
764             if (owner == null) {
765                 paramObj2 = new NullWrapper("java.lang.String");
766             }
767 
768             Object paramObj3 = new LongWrapper(expirationTime);
769 
770             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
771                     "lockFileEntry",
772                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
773 
774             Object returnObj = null;
775 
776             try {
777                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
778             }
779             catch (Exception e) {
780                 if (e instanceof com.liferay.portal.PortalException) {
781                     throw (com.liferay.portal.PortalException)e;
782                 }
783 
784                 if (e instanceof com.liferay.portal.SystemException) {
785                     throw (com.liferay.portal.SystemException)e;
786                 }
787 
788                 throw new com.liferay.portal.SystemException(e);
789             }
790 
791             return (com.liferay.lock.model.Lock)returnObj;
792         }
793         catch (com.liferay.portal.SystemException se) {
794             _log.error(se, se);
795 
796             throw se;
797         }
798     }
799 
800     public static com.liferay.lock.model.Lock refreshFileEntryLock(
801         HttpPrincipal httpPrincipal, java.lang.String lockUuid,
802         long expirationTime)
803         throws com.liferay.portal.SystemException,
804             com.liferay.portal.PortalException {
805         try {
806             Object paramObj0 = lockUuid;
807 
808             if (lockUuid == null) {
809                 paramObj0 = new NullWrapper("java.lang.String");
810             }
811 
812             Object paramObj1 = new LongWrapper(expirationTime);
813 
814             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
815                     "refreshFileEntryLock",
816                     new Object[] { paramObj0, paramObj1 });
817 
818             Object returnObj = null;
819 
820             try {
821                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
822             }
823             catch (Exception e) {
824                 if (e instanceof com.liferay.portal.PortalException) {
825                     throw (com.liferay.portal.PortalException)e;
826                 }
827 
828                 throw new com.liferay.portal.SystemException(e);
829             }
830 
831             return (com.liferay.lock.model.Lock)returnObj;
832         }
833         catch (com.liferay.portal.SystemException se) {
834             _log.error(se, se);
835 
836             throw se;
837         }
838     }
839 
840     public static void unlockFileEntry(HttpPrincipal httpPrincipal,
841         long folderId, java.lang.String name)
842         throws com.liferay.portal.SystemException {
843         try {
844             Object paramObj0 = new LongWrapper(folderId);
845 
846             Object paramObj1 = name;
847 
848             if (name == null) {
849                 paramObj1 = new NullWrapper("java.lang.String");
850             }
851 
852             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
853                     "unlockFileEntry", new Object[] { paramObj0, paramObj1 });
854 
855             try {
856                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
857             }
858             catch (Exception e) {
859                 throw new com.liferay.portal.SystemException(e);
860             }
861         }
862         catch (com.liferay.portal.SystemException se) {
863             _log.error(se, se);
864 
865             throw se;
866         }
867     }
868 
869     public static void unlockFileEntry(HttpPrincipal httpPrincipal,
870         long folderId, java.lang.String name, java.lang.String lockUuid)
871         throws com.liferay.portal.SystemException,
872             com.liferay.portal.PortalException {
873         try {
874             Object paramObj0 = new LongWrapper(folderId);
875 
876             Object paramObj1 = name;
877 
878             if (name == null) {
879                 paramObj1 = new NullWrapper("java.lang.String");
880             }
881 
882             Object paramObj2 = lockUuid;
883 
884             if (lockUuid == null) {
885                 paramObj2 = new NullWrapper("java.lang.String");
886             }
887 
888             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
889                     "unlockFileEntry",
890                     new Object[] { paramObj0, paramObj1, paramObj2 });
891 
892             try {
893                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
894             }
895             catch (Exception e) {
896                 if (e instanceof com.liferay.portal.PortalException) {
897                     throw (com.liferay.portal.PortalException)e;
898                 }
899 
900                 throw new com.liferay.portal.SystemException(e);
901             }
902         }
903         catch (com.liferay.portal.SystemException se) {
904             _log.error(se, se);
905 
906             throw se;
907         }
908     }
909 
910     public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileEntry(
911         HttpPrincipal httpPrincipal, long folderId, long newFolderId,
912         java.lang.String name, java.lang.String sourceFileName,
913         java.lang.String title, java.lang.String description,
914         java.lang.String[] tagsEntries, java.lang.String extraSettings,
915         byte[] bytes)
916         throws com.liferay.portal.PortalException,
917             com.liferay.portal.SystemException {
918         try {
919             Object paramObj0 = new LongWrapper(folderId);
920 
921             Object paramObj1 = new LongWrapper(newFolderId);
922 
923             Object paramObj2 = name;
924 
925             if (name == null) {
926                 paramObj2 = new NullWrapper("java.lang.String");
927             }
928 
929             Object paramObj3 = sourceFileName;
930 
931             if (sourceFileName == null) {
932                 paramObj3 = new NullWrapper("java.lang.String");
933             }
934 
935             Object paramObj4 = title;
936 
937             if (title == null) {
938                 paramObj4 = new NullWrapper("java.lang.String");
939             }
940 
941             Object paramObj5 = description;
942 
943             if (description == null) {
944                 paramObj5 = new NullWrapper("java.lang.String");
945             }
946 
947             Object paramObj6 = tagsEntries;
948 
949             if (tagsEntries == null) {
950                 paramObj6 = new NullWrapper("[Ljava.lang.String;");
951             }
952 
953             Object paramObj7 = extraSettings;
954 
955             if (extraSettings == null) {
956                 paramObj7 = new NullWrapper("java.lang.String");
957             }
958 
959             Object paramObj8 = bytes;
960 
961             if (bytes == null) {
962                 paramObj8 = new NullWrapper("[B");
963             }
964 
965             MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
966                     "updateFileEntry",
967                     new Object[] {
968                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
969                         paramObj5, paramObj6, paramObj7, paramObj8
970                     });
971 
972             Object returnObj = null;
973 
974             try {
975                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
976             }
977             catch (Exception e) {
978                 if (e instanceof com.liferay.portal.PortalException) {
979                     throw (com.liferay.portal.PortalException)e;
980                 }
981 
982                 if (e instanceof com.liferay.portal.SystemException) {
983                     throw (com.liferay.portal.SystemException)e;
984                 }
985 
986                 throw new com.liferay.portal.SystemException(e);
987             }
988 
989             return (com.liferay.portlet.documentlibrary.model.DLFileEntry)returnObj;
990         }
991         catch (com.liferay.portal.SystemException se) {
992             _log.error(se, se);
993 
994             throw se;
995         }
996     }
997 
998     public static boolean verifyFileEntryLock(HttpPrincipal httpPrincipal,
999         long folderId, java.lang.String name, java.lang.String lockUuid)
1000        throws com.liferay.portal.SystemException,
1001            com.liferay.portal.PortalException {
1002        try {
1003            Object paramObj0 = new LongWrapper(folderId);
1004
1005            Object paramObj1 = name;
1006
1007            if (name == null) {
1008                paramObj1 = new NullWrapper("java.lang.String");
1009            }
1010
1011            Object paramObj2 = lockUuid;
1012
1013            if (lockUuid == null) {
1014                paramObj2 = new NullWrapper("java.lang.String");
1015            }
1016
1017            MethodWrapper methodWrapper = new MethodWrapper(DLFileEntryServiceUtil.class.getName(),
1018                    "verifyFileEntryLock",
1019                    new Object[] { paramObj0, paramObj1, paramObj2 });
1020
1021            Object returnObj = null;
1022
1023            try {
1024                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1025            }
1026            catch (Exception e) {
1027                if (e instanceof com.liferay.portal.PortalException) {
1028                    throw (com.liferay.portal.PortalException)e;
1029                }
1030
1031                throw new com.liferay.portal.SystemException(e);
1032            }
1033
1034            return ((Boolean)returnObj).booleanValue();
1035        }
1036        catch (com.liferay.portal.SystemException se) {
1037            _log.error(se, se);
1038
1039            throw se;
1040        }
1041    }
1042
1043    private static Log _log = LogFactoryUtil.getLog(DLFileEntryServiceHttp.class);
1044}