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