001
014
015 package com.liferay.portal.kernel.util;
016
017 import java.io.InputStream;
018
019
022 public class DocumentConversionUtil {
023
024 public static InputStream convert(
025 String id, InputStream is, String sourceExtension,
026 String targetExtension)
027 throws Exception {
028
029 Object returnObj = PortalClassInvoker.invoke(
030 false, _convertMethodKey, id, is, sourceExtension, targetExtension);
031
032 if (returnObj != null) {
033 return (InputStream)returnObj;
034 }
035 else {
036 return null;
037 }
038 }
039
040 public static String[] getConversions(String extension) throws Exception {
041 Object returnObj = PortalClassInvoker.invoke(
042 false, _getConversionsMethodKey, extension);
043
044 if (returnObj != null) {
045 return (String[])returnObj;
046 }
047 else {
048 return null;
049 }
050 }
051
052 private static final String _CLASS_NAME =
053 "com.liferay.portlet.documentlibrary.util.DocumentConversionUtil";
054
055 private static MethodKey _convertMethodKey = new MethodKey(
056 _CLASS_NAME, "convert", String.class, InputStream.class, String.class,
057 String.class);
058 private static MethodKey _getConversionsMethodKey = new MethodKey(
059 _CLASS_NAME, "getConversions", String.class);
060
061 }