How would one translate the following Java fragment with an anonymous class to NetRexx?
// final char[] pswd; pswd = pass.toCharArray(); final String Userid = username; Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication (Userid, pswd); } }); // Thanks Marc _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Something like this should work:
protected char[] pswd;
protected String Userid; void auth(String username, String pass) {
pswd = pass.toCharArray(); Userid = username;
Authenticator.setDefault(new MyAuthenticator()); return; } private class MyAuthenticator extends Authenticator { protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(Userid, pswd); } }
A.
On 21 June 2012 15:16, Marc Remes <[hidden email]> wrote: How would one translate the following Java fragment with an anonymous class to NetRexx? Can't tweet, won't tweet! _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Alan
-- Needs more cowbell. |
Interesting.. Which magic invokes the getPasswordAuthentication method? Marc On 06/22/2012 01:15 AM, Alan Sampson wrote: > Something like this should work: > > > > protected char[] pswd; > protected String Userid; > > > void auth(String username, String pass) { > > > pswd = pass.toCharArray(); > Userid = username; > > Authenticator.setDefault(new MyAuthenticator()); > > > return; > } > > > private class MyAuthenticator extends Authenticator { > protected PasswordAuthentication getPasswordAuthentication() { > return new PasswordAuthentication(Userid, pswd); > } > } > > > > A. > > On 21 June 2012 15:16, Marc Remes <[hidden email] <mailto:[hidden email]>> wrote: > > How would one translate the following Java fragment with an anonymous class to NetRexx? > > // > final char[] pswd; > pswd = pass.toCharArray(); > final String Userid = username; > > Authenticator.setDefault(new Authenticator() { > protected PasswordAuthentication getPasswordAuthentication() { > return new PasswordAuthentication (Userid, pswd); > } > }); > // > > Thanks > Marc > > _________________________________________________ > Ibm-netrexx mailing list > [hidden email] <mailto:[hidden email]> > Online Archive : http://ibm-netrexx.215625.n3.__nabble.com/ <http://ibm-netrexx.215625.n3.nabble.com/> > > > > > -- > Can't tweet, won't tweet! > > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ > _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
On 21 June 2012 16:44, Marc Remes <[hidden email]> wrote:
A. Can't tweet, won't tweet! _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Alan
-- Needs more cowbell. |
Free forum by Nabble | Edit this page |