Hi Lance, > > Alternatively you can simply do: > > PrivilegedExceptionAction<Path> pea = () -> > > tempPath.toRealPath(); > > return AccessController.doPrivileged(pea); > > > > In this case, limited doPrivileged does not make whole lot of difference > jdk.zip explicitly grants for limited permissions and this doPrivileged block > is > one single operation, toRealPath. > > Do you have a preference here either way? I had that originally but changed > it to make it clearer why it was done.
I would prefer the way Mandy suggests. Furthermore, the imports in the test case can be condensed to: import java.io.IOException; import java.nio.file.FileSystem; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.spi.FileSystemProvider; import java.util.Map; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; Other than that: reviewed 😊 Best Christoph