Guest User

Untitled

a guest
Jan 14th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public class SimpleAuthenticator extends Authenticator {
  2.  
  3. private String user;
  4. private String password;
  5.  
  6. public SimpleAuthenticator() {
  7. }
  8.  
  9. public SimpleAuthenticator(String user, String password) {
  10. this.password = password;
  11. this.user = user;
  12. }
  13.  
  14. public String getPassword() {
  15. return password;
  16. }
  17.  
  18. public void setPassword(String password) {
  19. this.password = password;
  20. }
  21.  
  22. public String getUser() {
  23. return user;
  24. }
  25.  
  26. public void setUser(String user) {
  27. this.user = user;
  28. }
  29.  
  30. protected PasswordAuthentication getPasswordAuthentication() {
  31. return new PasswordAuthentication(user, password);
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment