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