Proxy認証越え

こないだGroovyいじって外部リソース見に行かせようとしたんですが、Proxyの認証にひっかかってしまいました。しかし↓見てようやく解決。
http://wisdom.sakura.ne.jp/system/java/javanet6.html
要は、

public class CustomAuthenticator extends Authenticator {
    protected PasswordAuthentication getPasswordAuthentication() { 
        return new PasswordAuthentication("ユーザー名","パスワード".toCharArray()); 
    } 
}

とかいうクラスを作って、
呼び出し側では

Authenticator.setDefault(new CustomAuthenticator());

とやればOK。java.net.Authenticatorなんて知らなかったよママン。
さっこれで社内からやりたい放題(ぇ