1 17 package com.sun.syndication.fetcher.impl; 18 19 import java.net.Authenticator ; 20 import java.net.PasswordAuthentication ; 21 22 25 public class TestBasicAuthenticator extends Authenticator { 26 27 30 protected PasswordAuthentication getPasswordAuthentication() { 31 if ("localhost".equals(getRequestingHost())) { 32 return new PasswordAuthentication ("username", "password".toCharArray()); 33 } else { 34 return null; 35 } 36 } 37 } 38 | Popular Tags |