Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package io.packagecloud.client;
 
Credentials, used to manage username/token combinations.
 
 public class Credentials implements io.packagecloud.client.interfaces.Credentials {
     private static Logger logger = LoggerProvider.getLogger();
    private final String username;
    private final String token;

    
Instantiates a new Credentials.

Parameters:
username the username
token the token
    public Credentials(String usernameString token) {
        if(username == null){
            throw new RuntimeException("username cannot be null");
        }
        if(token == null){
            throw new RuntimeException("token cannot be null");
        }
        this. = username;
        this. = token;
        .info(String.format("%s/%s"usernamegetTokenForLogging()));
    }
    @Override
    public String getToken() {
        return ;
    }
    @Override
    public String getUsername() {
        return ;
    }
    public String getTokenForLogging() {
        String halfToken = .substring(0,4);
        return halfToken + new String(new char[20]).replace("\0""*");
    }
New to GrepCode? Check out our FAQ X