use of org.jboss.vfs.VirtualFilePermission in project wildfly by wildfly.
the class ServletResourceOverlaysTestCase method single.
@Deployment
public static WebArchive single() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "single.war");
war.addAsWebResource(new StringAsset("a"), "a.txt");
war.addAsWebResource(new StringAsset("b"), "b.txt");
war.addClass(PathAccessCheckServlet.class);
war.addAsManifestResource(createPermissionsXmlAsset(new FilePermission("/-", "read"), new PropertyPermission("java.io.tmpdir", "read"), new VirtualFilePermission(Paths.get(System.getProperty("java.io.tmpdir"), "noaccess.txt").toFile().getAbsolutePath(), "read")), "permissions.xml");
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "test.jar");
jar.addAsManifestResource(new StringAsset("b - overlay"), new BasicPath("resources", "b.txt"));
jar.addAsManifestResource(new StringAsset("c - overlay"), new BasicPath("resources", "c.txt"));
war.addAsLibrary(jar);
return war;
}
Aggregations