Commons/src/main/java/eu/univento/commons/updater/CustomAuthenticator.java

23 lines
635 B
Java
Raw Normal View History

2016-08-02 23:53:40 +02:00
package eu.univento.commons.updater;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
/**
* @author joethei
* @version 0.1
*/
2016-09-17 11:55:07 +02:00
public class CustomAuthenticator extends Authenticator{
2016-08-02 23:53:40 +02:00
private static String username = "";
private static String password = "";
protected PasswordAuthentication getPasswordAuthentication() {
2016-09-17 11:55:07 +02:00
return new PasswordAuthentication (username, password.toCharArray());
2016-08-02 23:53:40 +02:00
}
public static void setPasswordAuthentication(String username, String password) {
2016-09-17 11:55:07 +02:00
CustomAuthenticator.username = username;
CustomAuthenticator.password = password;
2016-08-02 23:53:40 +02:00
}
}