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.xuggler;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    /**
020     * @author Alexander Chow
021     */
022    public class XugglerUtil {
023    
024            public static Xuggler getXuggler() {
025                    PortalRuntimePermission.checkGetBeanProperty(XugglerUtil.class);
026    
027                    return _xuggler;
028            }
029    
030            public static void installNativeLibraries(
031                            String name, XugglerInstallStatus xugglerInstallStatus)
032                    throws Exception {
033    
034                    getXuggler().installNativeLibraries(name, xugglerInstallStatus);
035            }
036    
037            public static boolean isEnabled() {
038                    return getXuggler().isEnabled();
039            }
040    
041            public static boolean isEnabled(boolean checkNativeLibraries) {
042                    return getXuggler().isEnabled(checkNativeLibraries);
043            }
044    
045            public static boolean isNativeLibraryInstalled() {
046                    return getXuggler().isNativeLibraryInstalled();
047            }
048    
049            public void setXuggler(Xuggler xuggler) {
050                    PortalRuntimePermission.checkSetBeanProperty(getClass());
051    
052                    _xuggler = xuggler;
053            }
054    
055            private static Xuggler _xuggler;
056    
057    }