Gets the username.

@return the username to use when connecting to the database
975489
public String getUser() {
    if (user != null) {
      return user;
    }
    return urlParser != null ? urlParser.getUsername() : null;
  }
108134
public function getUsername()
    {
        $username = null;
        $link = $this->getLink();

        if (!empty($link)) {
            $username = substr($link, strrpos($link, '/') + 1);
        }

        return $username;
    }
811293
@GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/username/{username}")
    @Description("Returns the user having the given username.")
    public PrincipalUserDto getUserByUsername(@Context HttpServletRequest req,
        @PathParam("username") final String userName) {

        Enumeration<String> headerNames = req.getHeaderNames();
        while(headerNames.hasMoreElements()) {
            String headerName = headerNames.nextElement();
            String headerValue = req.getHeader(headerName);
            System.out.println(headerName + ": " + headerValue);
        }

        if (userName == null || userName.isEmpty()) {
            throw new WebApplicationException("Username cannot be null or empty.", Status.BAD_REQUEST);
        }

        PrincipalUser remoteUser = validateAndGetOwner(req, null);
        PrincipalUser user = _uService.findUserByUsername(userName);

        if (user != null) {
            super.validateResourceAuthorization(req, user, remoteUser);
            return PrincipalUserDto.transformToDto(user);
        } else if (!remoteUser.isPrivileged()) {
            throw new WebApplicationException(Response.Status.FORBIDDEN.getReasonPhrase(), Response.Status.FORBIDDEN);
        } else {
            throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
        }
    }
577890
public String getName()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getName");
    
    String name = null;
    BaseDestinationDefinition def = getDefinition();
    if (def != null)
      name = getDefinition().getName();
  
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getName", name);
    
    return name; 
  }
331693
private String getSimpleUsername(String username) {
        int lastSlash = username.lastIndexOf('\\');
        if (lastSlash > -1) {
            username = username.substring(lastSlash + 1);
        }

        return username;
    }
1083511
def username(self):
        
        username = self.config.get("username")
        if not username:
            username = self.userinfo__preferred_username
        return username
1021173
public int getUserID()
    {
        int iUserID = -1;
        String strUserID = DBConstants.BLANK;
        if (this.getRecord().getRecordOwner() != null)
            if (this.getRecord().getRecordOwner().getTask() != null)
                if (this.getRecord().getRecordOwner().getTask().getApplication() != null)
            strUserID = ((BaseApplication)this.getRecord().getRecordOwner().getTask().getApplication()).getUserID();
        try   {
            iUserID = Integer.parseInt(strUserID);
            if (iUserID == 0)
                iUserID = -1;
        } catch (NumberFormatException e) {
            iUserID = -1;
        }
        return iUserID;
    }
865737
public String getName() {
        if (null == this.name && null != this.byteArray) {
            try {
                this.name = new String(this.byteArray, HeaderStorage.ENGLISH_CHARSET);
            } catch (UnsupportedEncodingException uee) {
                // no FFDC required
                // Invalid key name
                throw new IllegalArgumentException("Unsupported non-English name: " + new String(this.byteArray));
            }
        }
        return this.name;
    }
686782
def get_username(self):
        
        username = self.get_as_nullable_string("username")
        username = username if username != None else self.get_as_nullable_string("user")
        return username
1269619
public String getDatabaseName() {
    if (database != null) {
      return database;
    }
    return (urlParser != null && urlParser.getDatabase() != null) ? urlParser.getDatabase() : "";
  }
1054910
private String getUsernameForUserId(int id) {
        if (id > 0) {
            String username = userIdentityStore.getPortalUserName(id);
            if (username != null) {
                return username;
            }
            logger.warn(
                    "Invalid userID {} found when exporting a portlet; return system username instead",
                    id);
        }
        return systemUsername;
    }
366169
public User get(String loginname, String password) {
        Connection conn = null;
        User user = null;
        if (loginname == null || password == null) return null;
        String cryptpassword = MD5.encodeString(password,null);
        try {
            conn = ConnectionUtils.getConnection();
            user = userDAO.get(conn,loginname,cryptpassword);
        } catch(SQLException e) {
            logger.error(e.getMessage());
        } finally {
            DbUtils.closeQuietly(conn);
        }
        return user;
    }
603387
public function get_user_name()
    {
        if (is_object($this->user)) {
            return $this->user->get_username();
        }
        else if (isset($_SESSION['username'])) {
            return $_SESSION['username'];
        }
    }
711440
public String getAsString()
   {

      if (stringName == null)
      {

         StringBuilder str = new StringBuilder();
         for (int i = 0; i < getLength(); i++)
         {
            str.append(names[i].getAsString(true));
         }
         stringName = str.toString();
      }

      return stringName;
   }
1112836
public static String getUser(String userName, UserGroupInformation ugi) {
        if (StringUtils.isNotEmpty(userName)) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Returning userName {}", userName);
            }
            return userName;
        }

        if (ugi != null && StringUtils.isNotEmpty(ugi.getShortUserName())) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Returning ugi.getShortUserName {}", userName);
            }
            return ugi.getShortUserName();
        }

        try {
            return UserGroupInformation.getCurrentUser().getShortUserName();
        } catch (IOException e) {
            LOG.warn("Failed for UserGroupInformation.getCurrentUser() ", e);
            return System.getProperty("user.name");
        }
    }
266489
public String getUserID()
    {
        Record recUserInfo = (Record)this.getUserInfo();
        if (recUserInfo != null)
            return Converter.stripNonNumber(recUserInfo.getField(UserInfoModel.ID).toString());
        else
            return super.getUserID();
    }
428673
protected User getUser(String username) {
    Integer id = userIds().get(username.toLowerCase());
    if (id == null) {
      throw new IllegalStateException(format("Could not find ID corresponding to username [%s]", username));
    }

    return getUser(id);
  }