Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @GET @Path("/{username}") public javax.ws.rs.core.Response getUser(@PathParam("username") String username, @Context HttpServletRequest req)
        public virtual Response GetUser(string username, HttpServletRequest req)
        {
            Principal principal = req.UserPrincipal;

            if (principal == null || !principal.Name.Equals(username))
            {
                return(_output.notFound());
            }

            LoginContext loginContext = getLoginContextFromUserPrincipal(principal);
            UserManager  userManager  = _userManagerSupplier.getUserManager(loginContext.Subject(), false);

            try
            {
                User user = userManager.GetUser(username);
                return(_output.ok(new AuthorizationRepresentation(user)));
            }
            catch (InvalidArgumentsException)
            {
                return(_output.notFound());
            }
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @GET @Path(PATH_EXTENSION) public javax.ws.rs.core.Response getExtensionList(@PathParam("name") String name)
        public virtual Response GetExtensionList(string name)
        {
            try
            {
                return(_output.ok(this.ExtensionList(name)));
            }
            catch (PluginLookupException e)
            {
                return(_output.notFound(e));
            }
        }