模块  java.base
软件包  java.nio.file

Class LinkPermission

  • 实现的所有接口
    SerializableGuard

    public final class LinkPermission
    extends BasicPermission
    用于链接创建操作的Permission类。

    下表提供了权限允许的摘要说明,并讨论了授予代码权限的风险。

    Table shows permission target name, what the permission allows, and associated risks Permission Target Name What the Permission Allows Risks of Allowing this Permission hard Ability to add an existing file to a directory. This is sometimes known as creating a link, or hard link. Extreme care should be taken when granting this permission. It allows linking to any file or directory in the file system thus allowing the attacker access to all files. symbolic Ability to create symbolic links. Extreme care should be taken when granting this permission. It allows linking to any file or directory in the file system thus allowing the attacker to access to all files.
    从以下版本开始:
    1.7
    另请参见:
    Files.createLink(java.nio.file.Path, java.nio.file.Path)Files.createSymbolicLink(java.nio.file.Path, java.nio.file.Path, java.nio.file.attribute.FileAttribute<?>...)Serialized Form
    • 构造方法详细信息

      • LinkPermission

        public LinkPermission​(String name)
        构造具有指定名称的 LinkPermission
        参数
        name - 权限的名称。 它必须是“硬”或“象征性的”。
        异常
        IllegalArgumentException - 如果名称为空或无效
      • LinkPermission

        public LinkPermission​(String name,
                              String actions)
        构造具有指定名称的 LinkPermission
        参数
        name - 许可的名称; 必须是“硬”或“象征性的”。
        actions - 许可的行动; 必须是空字符串或null
        异常
        IllegalArgumentException - if name is empty or invalid, or actions is a non-empty string