se.michaelthelin.spotify.requests.authorization.AbstractAuthorizationRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spotify-web-api-java Show documentation
Show all versions of spotify-web-api-java Show documentation
A Java client for Spotify's Web API
package se.michaelthelin.spotify.requests.authorization;
import se.michaelthelin.spotify.Base64;
import se.michaelthelin.spotify.requests.AbstractRequest;
public abstract class AbstractAuthorizationRequest extends AbstractRequest {
protected AbstractAuthorizationRequest(final Builder builder) {
super(builder);
}
public static abstract class Builder> extends AbstractRequest.Builder {
protected Builder(final String clientId, final String clientSecret) {
super();
assert (clientId != null);
assert (clientSecret != null);
assert (!clientId.equals(""));
assert (!clientSecret.equals(""));
setHeader("Authorization", "Basic " + Base64.encode((clientId + ":" + clientSecret).getBytes()));
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy