Class FilePermissionUtils


  • public class FilePermissionUtils
    extends java.lang.Object
    • Method Summary

      Modifier and Type Method Description
      static void addDirectoryPath​(java.security.Permissions policy, java.lang.String configurationName, java.nio.file.Path path, java.lang.String permissions)
      Add access to path (and all files underneath it); this also creates the directory if it does not exist.
      static void addSingleFilePath​(java.security.Permissions policy, java.nio.file.Path path, java.lang.String permissions)
      Add access to single file path
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • addSingleFilePath

        public static void addSingleFilePath​(java.security.Permissions policy,
                                             java.nio.file.Path path,
                                             java.lang.String permissions)
                                      throws java.io.IOException
        Add access to single file path
        Parameters:
        policy - current policy to add permissions to
        path - the path itself
        permissions - set of file permissions to grant to the path
        Throws:
        java.io.IOException
      • addDirectoryPath

        public static void addDirectoryPath​(java.security.Permissions policy,
                                            java.lang.String configurationName,
                                            java.nio.file.Path path,
                                            java.lang.String permissions)
                                     throws java.io.IOException
        Add access to path (and all files underneath it); this also creates the directory if it does not exist.
        Parameters:
        policy - current policy to add permissions to
        configurationName - the configuration name associated with the path (for error messages only)
        path - the path itself
        permissions - set of file permissions to grant to the path
        Throws:
        java.io.IOException