eXo Kernel :: Commons Utils 2.4.10-UXP01

org.exoplatform.commons.utils
Class SecurityHelper

java.lang.Object
  extended by org.exoplatform.commons.utils.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 Summary
SecurityHelper()
           
 
Method Summary
static
<E> E
doPrivilegedAction(PrivilegedAction<E> action)
          Launches action in privileged mode.
static
<E> E
doPrivilegedExceptionAction(PrivilegedExceptionAction<E> action)
          Launches action in privileged mode.
static
<E> E
doPrivilegedIOExceptionAction(PrivilegedExceptionAction<E> action)
          Launches action in privileged mode.
static
<E> E
doPrivilegedMalformedURLExceptionAction(PrivilegedExceptionAction<E> action)
          Launches action in privileged mode.
static
<E> E
doPrivilegedNamingExceptionAction(PrivilegedExceptionAction<E> action)
          Launches action in privileged mode.
static
<E> E
doPrivilegedParserConfigurationAction(PrivilegedExceptionAction<E> action)
          Launches action in privileged mode.
static
<E> E
doPrivilegedParserConfigurationOrSAXExceptionAction(PrivilegedExceptionAction<E> action)
          Launches action in privileged mode.
static
<E> E
doPrivilegedSAXExceptionAction(PrivilegedExceptionAction<E> action)
          Launches action in privileged mode.
static
<E> E
doPrivilegedSQLExceptionAction(PrivilegedExceptionAction<E> action)
          Launches action in privileged mode.
static void validateSecurityPermission(Permission permission)
          Validate permissions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
IOException
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:
IOException
SQLException

doPrivilegedParserConfigurationOrSAXExceptionAction

public static <E> E doPrivilegedParserConfigurationOrSAXExceptionAction(PrivilegedExceptionAction<E> action)
                                                             throws ParserConfigurationException,
                                                                    SAXException
Launches action in privileged mode. Can throw only ParserConfigurationException, SAXException.

Type Parameters:
E -
Parameters:
action -
Returns:
Throws:
IOException
ParserConfigurationException
SAXException

doPrivilegedParserConfigurationAction

public static <E> E doPrivilegedParserConfigurationAction(PrivilegedExceptionAction<E> action)
                                               throws ParserConfigurationException
Launches action in privileged mode. Can throw only ParserConfigurationException.

Type Parameters:
E -
Parameters:
action -
Returns:
Throws:
IOException
ParserConfigurationException

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:
IOException
SAXException

doPrivilegedMalformedURLExceptionAction

public static <E> E doPrivilegedMalformedURLExceptionAction(PrivilegedExceptionAction<E> action)
                                                 throws MalformedURLException
Launches action in privileged mode. Can throw only SAXException.

Type Parameters:
E -
Parameters:
action -
Returns:
Throws:
IOException
MalformedURLException

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:

doPrivilegedExceptionAction

public static <E> E doPrivilegedExceptionAction(PrivilegedExceptionAction<E> action)
                                     throws PrivilegedActionException
Launches action in privileged mode.

Type Parameters:
E -
Parameters:
action -
Returns:
Throws:
PrivilegedActionException

validateSecurityPermission

public static void validateSecurityPermission(Permission permission)
Validate permissions.


eXo Kernel :: Commons Utils 2.4.10-UXP01

Copyright © 2014 eXo Platform SAS. All Rights Reserved.