throws ResourceNotFoundException, RemoteException {
if (key.startsWith("U:")) {
String name = key.substring(2);
try {
User user = UserUtil.findByPrimaryKey(name);
return new Resource(ras, key, userToName(user));
} catch (PortalException e) {
// fall through to "not found"
} catch (SystemException e) {
// fall through to "not found"
}
} else if (key.startsWith("G:")) {
String name = key.substring(2);
try {
GroupUtil.findByPrimaryKey(name);
return new Resource(ras, key, name);
} catch (PortalException e) {
} catch (SystemException e) {
}
} else if (key.startsWith("R:")) {
String name = key.substring(2);
try {
RoleUtil.findByPrimaryKey(name);
return new Resource(ras, key, name);
} catch (PortalException e) {
} catch (SystemException e) {
}
} else {
throw new IllegalArgumentException