1 11 package org.eclipse.ui.internal.net.auth; 12 13 import java.net.*; 14 15 public class NetAuthenticator extends Authenticator { 16 17 20 protected PasswordAuthentication getPasswordAuthentication() { 21 InetAddress address = getRequestingSite(); String prompt = getRequestingPrompt(); 27 String hostString = null; 30 if (address != null) { 31 hostString = address.getHostName(); 32 } 33 if (hostString == null) { 34 hostString = ""; } 36 String promptString = prompt; 37 if (prompt == null) { 38 promptString = ""; } 40 41 Authentication auth = UserValidationDialog.getAuthentication( 42 hostString, promptString); 43 if (auth != null) 44 return new PasswordAuthentication(auth.getUser(), auth 45 .getPassword().toCharArray()); 46 else 47 return null; 48 } 49 } 50 | Popular Tags |