23 lines
635 B
Java
23 lines
635 B
Java
package eu.univento.commons.updater;
|
|
|
|
import java.net.Authenticator;
|
|
import java.net.PasswordAuthentication;
|
|
|
|
/**
|
|
* @author joethei
|
|
* @version 0.1
|
|
*/
|
|
public class CustomAuthenticator extends Authenticator{
|
|
|
|
private static String username = "";
|
|
private static String password = "";
|
|
|
|
protected PasswordAuthentication getPasswordAuthentication() {
|
|
return new PasswordAuthentication (username, password.toCharArray());
|
|
}
|
|
|
|
public static void setPasswordAuthentication(String username, String password) {
|
|
CustomAuthenticator.username = username;
|
|
CustomAuthenticator.password = password;
|
|
}
|
|
} |