# UserPrincipalLookupService

public abstract class **UserPrincipalLookupService** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
An object to lookup user and group principals by name. A `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipal.html`
represents an identity that may be used to determine access rights to objects
in a file system. A `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/GroupPrincipal.html` represents a *group identity* .
A `UserPrincipalLookupService` defines methods to lookup identities by
name or group name (which are typically user or account names). Whether names
and group names are case sensitive or not depends on the implementation.
The exact definition of a group is implementation specific but typically a
group represents an identity created for administrative purposes so as to
determine the access rights for the members of the group. In particular it is
implementation specific if the *namespace* for names and groups is the
same or is distinct. To ensure consistent and correct behavior across
platforms it is recommended that this API be used as if the namespaces are
distinct. In other words, the `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalLookupService.html#lookupPrincipalByName(java.lang.String)` should be used to lookup users, and `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalLookupService.html#lookupPrincipalByGroupName(java.lang.String)` should be used to
lookup groups.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileSystem.html#getUserPrincipalLookupService()`

### Protected Constructor Summary

|---|---|
|   | [UserPrincipalLookupService](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalLookupService.html#UserPrincipalLookupService())() Initializes a new instance of this class. |

### Public Method Summary

|---|---|
| abstract [GroupPrincipal](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/GroupPrincipal.html) | [lookupPrincipalByGroupName](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalLookupService.html#lookupPrincipalByGroupName(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) group) Lookup a group principal by group name. |
| abstract [UserPrincipal](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipal.html) | [lookupPrincipalByName](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalLookupService.html#lookupPrincipalByName(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Lookup a user principal by name. |

### Inherited Method Summary

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

## Protected Constructors

#### protected
**UserPrincipalLookupService**
()

Initializes a new instance of this class.

## Public Methods

#### public abstract [GroupPrincipal](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/GroupPrincipal.html)
**lookupPrincipalByGroupName**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) group)

Lookup a group principal by group name.

Where an implementation does not support any notion of group then
this method always throws `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalNotFoundException.html`. Where
the namespace for user accounts and groups is the same, then this method
is identical to invoking `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalLookupService.html#lookupPrincipalByName(java.lang.String)`.

##### Parameters

| group | the string representation of the group to lookup |
|---|---|

##### Returns

- a group principal

##### Throws

| [UserPrincipalNotFoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalNotFoundException.html) | the principal does not exist or is not a group |
| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | In the case of the default provider, and a security manager is installed, it checks `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/RuntimePermission.html`("lookupUserInformation") |
|---|---|

#### public abstract [UserPrincipal](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipal.html)
**lookupPrincipalByName**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name)

Lookup a user principal by name.

##### Parameters

| name | the string representation of the user principal to lookup |
|---|---|

##### Returns

- a user principal

##### Throws

| [UserPrincipalNotFoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/UserPrincipalNotFoundException.html) | the principal does not exist |
| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | if an I/O error occurs |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | In the case of the default provider, and a security manager is installed, it checks `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/RuntimePermission.html`("lookupUserInformation") |
|---|---|