/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
class WindowsUserPrincipals {
private WindowsUserPrincipals() { }
// String representation of SID
// SID type
private final int sidType;
// Account name (if available) or SID
this.accountName = accountName;
}
// package-private
return sidString;
}
return accountName;
}
switch (sidType) {
default: type = "Unknown";
}
}
if (obj == this)
return true;
return false;
}
public int hashCode() {
}
}
}
}
try {
// pre-Windows XP system?
throw new AssertionError();
}
} catch (WindowsException x) {
throw new IOException("Unable to convert SID to String: " +
x.errorString());
}
// lookup account; if not available then use the SID as the name
try {
} catch (WindowsException x) {
}
if ((sidType == SidTypeGroup) ||
(sidType == SidTypeWellKnownGroup) ||
{
} else {
}
}
}
// invoke LookupAccountName to get buffer size needed for SID
int size = 0;
try {
} catch (WindowsException x) {
if (x.lastError() == ERROR_NONE_MAPPED)
throw new UserPrincipalNotFoundException(name);
}
assert size > 0;
// allocate buffer and re-invoke LookupAccountName get SID
try {
// can this happen?
throw new AssertionError("SID change during lookup");
}
// return user principal
} catch (WindowsException x) {
} finally {
}
}
}