Class SecurityHelper


  • public class SecurityHelper
    extends Object
    Helps running code in privileged
    Version:
    $Id: SecurityHelper.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
    Author:
    Nikolay Zamosenchuk
    • Constructor Detail

      • SecurityHelper

        public SecurityHelper()
    • Method Detail

      • doPrivilegedIOExceptionAction

        public static <E> E doPrivilegedIOExceptionAction​(PrivilegedExceptionAction<E> action)
                                                   throws IOException
        Launches action in privileged mode. Can throw only IO exception.
        Type Parameters:
        E -
        Parameters:
        action -
        Returns:
        Throws:
        IOException
      • doPrivilegedNamingExceptionAction

        public static <E> E doPrivilegedNamingExceptionAction​(PrivilegedExceptionAction<E> action)
                                                       throws NamingException
        Launches action in privileged mode. Can throw only NamingException.
        Type Parameters:
        E -
        Parameters:
        action -
        Returns:
        Throws:
        NamingException
      • doPrivilegedSQLExceptionAction

        public static <E> E doPrivilegedSQLExceptionAction​(PrivilegedExceptionAction<E> action)
                                                    throws SQLException
        Launches action in privileged mode. Can throw only SQL exception.
        Type Parameters:
        E -
        Parameters:
        action -
        Returns:
        Throws:
        SQLException
      • doPrivilegedSAXExceptionAction

        public static <E> E doPrivilegedSAXExceptionAction​(PrivilegedExceptionAction<E> action)
                                                    throws SAXException
        Launches action in privileged mode. Can throw only SAXException.
        Type Parameters:
        E -
        Parameters:
        action -
        Returns:
        Throws:
        SAXException
      • doPrivilegedAction

        public static <E> E doPrivilegedAction​(PrivilegedAction<E> action)
        Launches action in privileged mode. Can throw only runtime exceptions.
        Type Parameters:
        E -
        Parameters:
        action -
        Returns:
      • validateSecurityPermission

        public static void validateSecurityPermission​(Permission permission)
        Validate permissions.