1
14
15 package com.liferay.portal.kernel.util;
16
17 import java.io.InputStream;
18
19
24 public class DocumentConversionUtil {
25
26 public static InputStream convert(
27 String id, InputStream is, String sourceExtension,
28 String targetExtension)
29 throws Exception {
30
31 Object returnObj = PortalClassInvoker.invoke(
32 false, _convertMethodKey, id, is, sourceExtension, targetExtension);
33
34 if (returnObj != null) {
35 return (InputStream)returnObj;
36 }
37 else {
38 return null;
39 }
40 }
41
42 public static String[] getConversions(String extension) throws Exception {
43 Object returnObj = PortalClassInvoker.invoke(
44 false, _getConversionsMethodKey, extension);
45
46 if (returnObj != null) {
47 return (String[])returnObj;
48 }
49 else {
50 return null;
51 }
52 }
53
54 private static final String _CLASS_NAME =
55 "com.liferay.portlet.documentlibrary.util.DocumentConversionUtil";
56
57 private static MethodKey _convertMethodKey = new MethodKey(
58 _CLASS_NAME, "convert", String.class, InputStream.class, String.class,
59 String.class);
60 private static MethodKey _getConversionsMethodKey = new MethodKey(
61 _CLASS_NAME, "getConversions", String.class);
62
63 }