001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }