1 11 package org.eclipse.update.internal.ui.security; 12 13 import java.net.*; 14 15 18 public class UpdateManagerAuthenticator extends Authenticator { 19 21 24 protected PasswordAuthentication getPasswordAuthentication() { 25 InetAddress address = getRequestingSite(); String prompt = getRequestingPrompt(); 31 String hostString = null; 34 if (address != null) { 35 hostString = address.getHostName(); 36 } 37 if (hostString == null) { 38 hostString = ""; } 40 String promptString = prompt; 41 if (prompt == null) { 42 promptString = ""; } 44 45 Authentication auth = UserValidationDialog.getAuthentication( 46 hostString, promptString); 47 if (auth != null) 48 return new PasswordAuthentication(auth.getUser(), auth 49 .getPassword().toCharArray()); 50 else 51 return null; 52 } 53 } 54 | Popular Tags |