# LinkPermission

public final class **LinkPermission** extends [BasicPermission](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/BasicPermission.html)  
The `Permission` class for link creation operations.

The following table provides a summary description of what the permission
allows, and discusses the risks of granting code the permission.

| 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. |

<br />

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/Files.html#createLink(java.nio.file.Path,%20java.nio.file.Path)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/Files.html#createSymbolicLink(java.nio.file.Path,%20java.nio.file.Path,%20java.nio.file.attribute.FileAttribute<?>...)`

### Public Constructor Summary

|---|---|
|   | [LinkPermission](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/LinkPermission.html#LinkPermission(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Constructs a `LinkPermission` with the specified name. |
|   | [LinkPermission](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/LinkPermission.html#LinkPermission(java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) actions) Constructs a `LinkPermission` with the specified name. |

### Inherited Method Summary

From class [java.security.BasicPermission](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/BasicPermission.html)

|---|---|
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getActions](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/BasicPermission.html#getActions())() |
| boolean | [implies](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/BasicPermission.html#implies(java.security.Permission))([Permission](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Permission.html) p) |

From class [java.security.Permission](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Permission.html)

|---|---|
| void | [checkGuard](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Permission.html#checkGuard(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) object) Determines whether or not to allow access to the guarded object `object`. |
| abstract [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getActions](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Permission.html#getActions())() |
| final [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getName](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Permission.html#getName())() |
| abstract boolean | [implies](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Permission.html#implies(java.security.Permission))([Permission](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Permission.html) permission) |
| [PermissionCollection](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/PermissionCollection.html) | [newPermissionCollection](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Permission.html#newPermissionCollection())() |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.security.Guard](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Guard.html)

|---|---|
| abstract void | [checkGuard](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/Guard.html#checkGuard(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) object) Determines whether or not to allow access to the guarded object `object`. |

## Public Constructors

#### public
**LinkPermission**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name)

Constructs a `LinkPermission` with the specified name.

##### Parameters

| name | the name of the permission. It must be "hard" or "symbolic". |
|---|---|

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if name is empty or invalid |
|---|---|

#### public
**LinkPermission**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) actions)

Constructs a `LinkPermission` with the specified name.

##### Parameters

| name | the name of the permission; must be "hard" or "symbolic". |
| actions | the actions for the permission; must be the empty string or `null` |
|---|---|

##### Throws

| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if name is empty or invalid, or actions is a non-empty string |
|---|---|