001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.metadata;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
020    import com.liferay.portlet.dynamicdatamapping.storage.Fields;
021    
022    import java.io.File;
023    import java.io.InputStream;
024    
025    import java.lang.reflect.Field;
026    
027    import java.util.Map;
028    
029    /**
030     * @author Miguel Pastor
031     */
032    public class RawMetadataProcessorUtil {
033    
034            public static Map<String, Field[]> getFields() {
035                    return getRawMetadataProcessor().getFields();
036            }
037    
038            public static Map<String, Fields> getRawMetadataMap(
039                            String extension, String mimeType, File file)
040                    throws PortalException, SystemException {
041    
042                    return getRawMetadataProcessor().getRawMetadataMap(
043                            extension, mimeType, file);
044            }
045    
046            public static Map<String, Fields> getRawMetadataMap(
047                            String extension, String mimeType, InputStream inputStream)
048                    throws PortalException, SystemException {
049    
050                    return getRawMetadataProcessor().getRawMetadataMap(
051                            extension, mimeType, inputStream);
052            }
053    
054            public static RawMetadataProcessor getRawMetadataProcessor() {
055                    PortalRuntimePermission.checkGetBeanProperty(
056                            RawMetadataProcessorUtil.class);
057    
058                    return _rawMetadataProcessor;
059            }
060    
061            public void setRawMetadataProcessor(
062                    RawMetadataProcessor rawMetadataProcessor) {
063    
064                    PortalRuntimePermission.checkSetBeanProperty(getClass());
065    
066                    _rawMetadataProcessor = rawMetadataProcessor;
067            }
068    
069            private static RawMetadataProcessor _rawMetadataProcessor;
070    
071    }