Class PermissionUtil

java.lang.Object
org.jboss.resteasy.utils.PermissionUtil

public final class PermissionUtil extends Object
Author:
David M. Lloyd Taken from: https://github.com/wildfly/wildfly-core/blob/master/testsuite/shared/src/main/java/org/jboss/as/test/shared/PermissionUtils.java
  • Constructor Details

    • PermissionUtil

      public PermissionUtil()
  • Method Details

    • createPermissionsXmlAsset

      public static org.jboss.shrinkwrap.api.asset.Asset createPermissionsXmlAsset(Permission... permissions)
    • createPermissionsXmlAsset

      public static org.jboss.shrinkwrap.api.asset.Asset createPermissionsXmlAsset(Iterable<? extends Permission> permissions, Permission... additionalPermissions)
    • createPermissionsXmlAsset

      public static org.jboss.shrinkwrap.api.asset.Asset createPermissionsXmlAsset(Iterable<? extends Permission> permissions)
    • createPermissionsXml

      public static byte[] createPermissionsXml(Permission... permissions)
    • createPermissionsXml

      public static byte[] createPermissionsXml(Iterable<? extends Permission> permissions, Permission... additionalPermissions)
    • addModuleFilePermission

      public static Collection<Permission> addModuleFilePermission(String... moduleNames)
      This should only be used as a workaround for issues with API's outside RESTEasy where something like a ServiceLoader needs access to an implementation.

      Adds file permissions for every JAR in the modules directory. The module.jar.path system property must be set.

      Parameters:
      moduleNames - the module names to add file permissions for
      Returns:
      a collection of permissions required
    • createTempDirPermission

      public static Collection<FilePermission> createTempDirPermission(String actions)
      Creates the permissions required for the java.io.tmpdir. This adds permissions to read the directory, then adds permissions for all files and subdirectories of the temporary directory. The actions are used for the latter permission.
      Parameters:
      actions - the actions required for the temporary directory
      Returns:
      the permissions required