Package org.jboss.resteasy.utils
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PermissionUtil.Builder
A builder for creating a permission file.
-
Constructor Summary
Constructors Constructor Description PermissionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collection<Permission>
addModuleFilePermission(String... moduleNames)
This should only be used as a workaround for issues with API's outside RESTEasy where something like aServiceLoader
needs access to an implementation.static byte[]
createPermissionsXml(Iterable<? extends Permission> permissions, Permission... additionalPermissions)
static byte[]
createPermissionsXml(Permission... permissions)
static org.jboss.shrinkwrap.api.asset.Asset
createPermissionsXmlAsset(Iterable<? extends Permission> permissions)
static org.jboss.shrinkwrap.api.asset.Asset
createPermissionsXmlAsset(Iterable<? extends Permission> permissions, Permission... additionalPermissions)
static org.jboss.shrinkwrap.api.asset.Asset
createPermissionsXmlAsset(Permission... permissions)
static Collection<FilePermission>
createTempDirPermission(String actions)
Creates the permissions required for thejava.io.tmpdir
.
-
-
-
Method Detail
-
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 aServiceLoader
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 thejava.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
-
-