UserPrincipalLookupService.java revision 893
893N/A * Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. 893N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 893N/A * This code is free software; you can redistribute it and/or modify it 893N/A * under the terms of the GNU General Public License version 2 only, as 893N/A * published by the Free Software Foundation. Sun designates this 893N/A * particular file as subject to the "Classpath" exception as provided 893N/A * by Sun in the LICENSE file that accompanied this code. 893N/A * This code is distributed in the hope that it will be useful, but WITHOUT 893N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 893N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 893N/A * version 2 for more details (a copy is included in the LICENSE file that 893N/A * accompanied this code). 893N/A * You should have received a copy of the GNU General Public License version 893N/A * 2 along with this work; if not, write to the Free Software Foundation, 893N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 893N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 893N/A * CA 95054 USA or visit www.sun.com if you need additional information or 893N/A * An object to lookup user and group principals by name. A {@link UserPrincipal} 893N/A * represents an identity that may be used to determine access rights to objects 893N/A * in a file system. A {@link GroupPrincipal} represents a <em>group identity</em>. 893N/A * A {@code UserPrincipalLookupService} defines methods to lookup identities by 893N/A * name or group name (which are typically user or account names). Whether names 893N/A * and group names are case sensitive or not depends on the implementation. 893N/A * The exact definition of a group is implementation specific but typically a 893N/A * group represents an identity created for administrative purposes so as to 893N/A * determine the access rights for the members of the group. In particular it is 893N/A * implementation specific if the <em>namespace</em> for names and groups is the 893N/A * same or is distinct. To ensure consistent and correct behavior across 893N/A * platforms it is recommended that this API be used as if the namespaces are 893N/A * distinct. In other words, the {@link #lookupPrincipalByName 893N/A * lookupPrincipalByName} should be used to lookup users, and {@link 893N/A * #lookupPrincipalByGroupName lookupPrincipalByGroupName} should be used to 893N/A * @see java.nio.file.FileSystem#getUserPrincipalLookupService 893N/A * Initializes a new instance of this class. 893N/A * Lookup a user principal by name. 893N/A * The string representation of the user principal to lookup 893N/A * @return A user principal 893N/A * @throws UserPrincipalNotFoundException 893N/A * The principal does not exist 893N/A * If an I/O error occurs 893N/A * @throws SecurityException 893N/A * In the case of the default provider, and a security manager is 893N/A * installed, it checks {@link RuntimePermission}<tt>("lookupUserInformation")</tt> 893N/A * Lookup a group principal by group name. 893N/A * <p> Where an implementation does not support any notion of group then 893N/A * this method always throws {@link UserPrincipalNotFoundException}. Where 893N/A * the namespace for user accounts and groups is the same, then this method 893N/A * is identical to invoking {@link #lookupPrincipalByName 893N/A * lookupPrincipalByName}. 893N/A * The string representation of the group to lookup 893N/A * @return A user principal. 893N/A * @throws UserPrincipalNotFoundException 893N/A * The principal does not exist or is not a group 893N/A * If an I/O error occurs 893N/A * @throws SecurityException 893N/A * In the case of the default provider, and a security manager is 893N/A * installed, it checks {@link RuntimePermission}<tt>("lookupUserInformation")</tt>