code: public void addPermission(String path) {
          if (path == null) {
              return;
          }
  
          if (securityManager != null) {
              Permission permission = null;
              if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                  if (!path.endsWith("/")) {
                      path = path + "/";
                  }
                  permission = new JndiPermission(path + "*");
                  addPermission(permission);
              } else {
                  if (!path.endsWith(File.separator)) {
                      permission = new FilePermission(path, "read");
                      addPermission(permission);
                      path = path + File.separator;
                  }
                  permission = new FilePermission(path + "-", "read");
                  addPermission(permission);
              }
          }
      }
docs: If there is a Java SecurityManager create a read FilePermission
  or JndiPermission for the file directory path.
  
  @param path file directory path