Package org.jboss.resteasy.utils
Class PermissionUtil
java.lang.Object
org.jboss.resteasy.utils.PermissionUtil
- 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 ClassesModifier and TypeClassDescriptionstatic classA builder for creating a permission file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Permission>addModuleFilePermission(String... moduleNames) This should only be used as a workaround for issues with API's outside RESTEasy where something like aServiceLoaderneeds access to an implementation.static byte[]createPermissionsXml(Iterable<? extends Permission> permissions, Permission... additionalPermissions) static byte[]createPermissionsXml(Permission... permissions) static org.jboss.shrinkwrap.api.asset.AssetcreatePermissionsXmlAsset(Iterable<? extends Permission> permissions) static org.jboss.shrinkwrap.api.asset.AssetcreatePermissionsXmlAsset(Iterable<? extends Permission> permissions, Permission... additionalPermissions) static org.jboss.shrinkwrap.api.asset.AssetcreatePermissionsXmlAsset(Permission... permissions) static Collection<FilePermission>createTempDirPermission(String actions) Creates the permissions required for thejava.io.tmpdir.
-
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
-
createPermissionsXml
public static byte[] createPermissionsXml(Iterable<? extends Permission> permissions, Permission... additionalPermissions) -
addModuleFilePermission
This should only be used as a workaround for issues with API's outside RESTEasy where something like aServiceLoaderneeds access to an implementation.Adds file permissions for every JAR in the modules directory. The
module.jar.pathsystem property must be set.- Parameters:
moduleNames- the module names to add file permissions for- Returns:
- a collection of permissions required
-
createTempDirPermission
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
-