b0VIM 6.2      .?   merlyn                                  tralfamadore                            ~merlyn/school/src/benchmarks/INBOX/AspectJ_in_Action/10.4_authentication-aspectj/com/sun/security/auth/callback/TextCallbackHandler2.java                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          3210#"! U                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     tp       p               q         m            =                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ad          p           M  I  H             o  =          y  Z  >  "               n  `  %                [    
  
  
  
  
  
  
  a
  Z
  *
  	  	  q	  i	  <	  	          W              h  ;               O                d  :  ,          u  C  .            m  H              _  ^  0                        pc.setPassword(readPassword(System.in));              System.err.flush();             System.err.print(pc.getPrompt());              PasswordCallback pc = (PasswordCallback) callbacks[i];             } else if (callbacks[i] instanceof PasswordCallback) {                   nc.setName(result);              }                 result = nc.getDefaultName();             if (result.equals("")) {             String result = readLine();              System.err.flush();             }                     " [" + nc.getDefaultName() + "] ");                 System.err.print(nc.getPrompt() +             } else {                 System.err.print(nc.getPrompt());             if (nc.getDefaultName() == null) {              NameCallback nc = (NameCallback) callbacks[i];             } else if (callbacks[i] instanceof NameCallback) {                          }                 System.err.println(text);             if (text != null) {             }                 text += message;             if (message != null) {             String message = tc.getMessage();              }                 callbacks[i], "Unrecognized message type");                 throw new UnsupportedCallbackException(             default:                 break;                 text = "Error: ";             case TextOutputCallback.ERROR:                 break;                 text = "Warning: ";             case TextOutputCallback.WARNING:                 break;                 text = "";             case TextOutputCallback.INFORMATION:             switch (tc.getMessageType()) {             String text;              TextOutputCallback tc = (TextOutputCallback) callbacks[i];             if (callbacks[i] instanceof TextOutputCallback) {         for (int i = 0; i < callbacks.length; i++) {          ConfirmationCallback confirmation = null;     {         throws IOException, UnsupportedCallbackException     public void handle(Callback[] callbacks)      */      * instance of NameCallback or PasswordCallback      * @throws UnsupportedCallbackException if the callback is not an      * @throws IOException if an input or output error occurs.      * @param callbacks the callbacks to handle      *      * Handles the specified set of callbacks.     /**      public TextCallbackHandler2() { }      */       * CallbackHandler.      * This can be used by JAAS applications to instantiate a      * command line for answers to authentication questions.      * <p>Creates a callback handler that prompts and reads from the     /**  public class TextCallbackHandler2 implements CallbackHandler {   */  * @see javax.security.auth.callback  * CallbackHandler  * This can be used by a JAAS application to instantiate a  * questions.  * Prompts and reads from the command line for answers to authentication  * <p> /**  import java.util.Arrays; import java.io.PushbackInputStream; import java.io.InputStreamReader; import java.io.InputStream; import java.io.IOException; import java.io.BufferedReader; /* Java imports */  import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.auth.callback.TextOutputCallback; import javax.security.auth.callback.PasswordCallback; import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.ConfirmationCallback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.Callback; /* JAAS imports */  package com.sun.security.auth.callback;   */  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.  * Copyright 2002 Sun Microsystems, Inc. All rights reserved.  *  * @(#)TextCallbackHandler.java 1.5 01/12/03 /* ad         =         h  ?          j  *          t  c  /            n  P  7  -              :  
  
  
  r
  ]
  -
  
  	  	  	  ~	  P	  4	   	  	      |  n  B                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }     }         confirmation.setSelectedIndex(result);          }             result = defaultOption;         } catch (NumberFormatException e) {             result = options[result].value;             }             result = defaultOption;             if (result < 0 || result > (options.length - 1)) {             result = Integer.parseInt(readLine());         try {         int result;         System.err.flush();         System.err.print("Enter a number: ");         }             }                 (options[i].value == defaultOption ? " [default]" : ""));                 i + ". " + options[i].name +             System.err.println(             // defaultOption is an option value             } else {                 (i == defaultOption ? " [default]" : ""));                 i + ". " + options[i].name +             System.err.println(             // defaultOption is an index into the options array             if (optionType == ConfirmationCallback.UNSPECIFIED_OPTION) {         for (int i = 0; i < options.length; i++) {          }             System.err.println(prompt);         if (!prompt.equals("")) {         prompt = prefix + prompt;         }             prompt = "";         if (prompt == null) {         String prompt = confirmation.getPrompt();          int defaultOption = confirmation.getDefaultOption();          }             confirmation, "Unrecognized option type: " + optionType);             throw new UnsupportedCallbackException(         default:             break;             }             options[i].value = i;             for (int i = 0; i < options.length; i++) {             options = new OptionInfo[optionStrings.length];             String[] optionStrings = confirmation.getOptions();         case ConfirmationCallback.UNSPECIFIED_OPTION:             break;             };             new OptionInfo("Cancel", ConfirmationCallback.CANCEL)             new OptionInfo("OK", ConfirmationCallback.OK),             options = new OptionInfo[] {         case ConfirmationCallback.OK_CANCEL_OPTION:             break;             };             new OptionInfo("Cancel", ConfirmationCallback.CANCEL) ad                r  q  \  (            v  L  B  <  ;              \  '              t  s  T  <  -  ,              y  x  a  A    
  
  
  ]
  H
  +
  
  
  
  	  	  	  t	  3	  	                h  O  E  D                m  4  .          q  ^  5              b                u  U  G  =  <          o  2          u  8                 new OptionInfo("No", ConfirmationCallback.NO),             new OptionInfo("Yes", ConfirmationCallback.YES),             options = new OptionInfo[] {         case ConfirmationCallback.YES_NO_CANCEL_OPTION:             break;             };             new OptionInfo("No", ConfirmationCallback.NO)             new OptionInfo("Yes", ConfirmationCallback.YES),             options = new OptionInfo[] {         case ConfirmationCallback.YES_NO_OPTION:         switch (optionType) {         int optionType = confirmation.getOptionType();         OptionInfo[] options;          }             }             this.value = value;             this.name = name;             OptionInfo(String name, int value) {             int value;             String name;         class OptionInfo {          }             confirmation, "Unrecognized message type: " + messageType);             throw new UnsupportedCallbackException(         default:             break;             prefix = "";         case ConfirmationCallback.INFORMATION:             break;             prefix = "Error: ";         case ConfirmationCallback.ERROR:             break;             prefix =  "Warning: ";         case ConfirmationCallback.WARNING:         switch (messageType) {         int messageType = confirmation.getMessageType();         String prefix;     {         throws IOException, UnsupportedCallbackException     private void doConfirmation(ConfirmationCallback confirmation)      }         return ret;          Arrays.fill(buf, ' ');         System.arraycopy(buf, 0, ret, 0, offset);         char[] ret = new char[offset];          }             return null;         if (offset == 0) {          }             }             break;             buf[offset++] = (char) c;             }                 lineBuffer = buf;                 Arrays.fill(lineBuffer, ' ');                 System.arraycopy(lineBuffer, 0, buf, 0, offset);                 room = buf.length - offset - 1;                 buf = new char[offset + 128];             if (--room < 0) {             default:              }                 break;                 done = true;             } else {                 ((PushbackInputStream)in).unread(c2);                 }                 in = new PushbackInputStream(in);                 if (!(in instanceof PushbackInputStream)) {             if ((c2 != '\n') && (c2 != -1)) {             int c2 = in.read();             case '\r':              break;             done = true;             case '\n':             case -1:             switch (c = in.read()) {         while (!done) {         boolean done = false;          int c;         int offset = 0;         int room = buf.length;          buf = lineBuffer = new char[128];          int i;         char[] buf;         char[] lineBuffer;          private char[] readPassword(InputStream in) throws IOException {     /* Reads a user password from an input stream */      }             (new InputStreamReade        /*         return user;         System.out.println(user);         String user = "testUser";     private String readLine() throws IOException {     /* Reads a line of input */      }         }             doConfirmation(confirmation);         if (confirmation != null) {         /* Do the confirmation callback last. */                      }             }                 callbacks[i], "Unrecognized Callback");             throw new UnsupportedCallbackException(             } else {              confirmation = (ConfirmationCallback) callbacks[i];             } else if (callbacks[i] instanceof ConfirmationCallback) {        ad         m             \              q  ]  N  M  #  "                k  T  ;  (  '          T  B                  S  #  
  
  
  
  ^
  K
  =
  3
  2
  
  	  	  	  	  	  {	  z	  f	  [	  U	  T	  	          c  8            w  ^  K  :              h  7                m  <          z  B                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             new OptionInfo("No", ConfirmationCallback.NO),             new OptionInfo("Yes", ConfirmationCallback.YES),             options = new OptionInfo[] {         case ConfirmationCallback.YES_NO_CANCEL_OPTION:             break;             };             new OptionInfo("No", ConfirmationCallback.NO)             new OptionInfo("Yes", ConfirmationCallback.YES),             options = new OptionInfo[] {         case ConfirmationCallback.YES_NO_OPTION:         switch (optionType) {         int optionType = confirmation.getOptionType();         OptionInfo[] options;          }             }             this.value = value;             this.name = name;             OptionInfo(String name, int value) {             int value;             String name;         class OptionInfo {          }             confirmation, "Unrecognized message type: " + messageType);             throw new UnsupportedCallbackException(         default:             break;             prefix = "";         case ConfirmationCallback.INFORMATION:             break;             prefix = "Error: ";         case ConfirmationCallback.ERROR:             break;             prefix =  "Warning: ";         case ConfirmationCallback.WARNING:         switch (messageType) {         int messageType = confirmation.getMessageType();         String prefix;     {         throws IOException, UnsupportedCallbackException     private void doConfirmation(ConfirmationCallback confirmation)      }         */         return ret;          Arrays.fill(buf, ' ');         System.arraycopy(buf, 0, ret, 0, offset);         char[] ret = new char[offset];          }             return null;         if (offset == 0) {          }             }             break;             buf[offset++] = (char) c;             }                 lineBuffer = buf;                 Arrays.fill(lineBuffer, ' ');                 System.arraycopy(lineBuffer, 0, buf, 0, offset);                 room = buf.length - offset - 1;                 buf = new char[offset + 128];             if (--room < 0) {             default:              }                 break;                 done = true;             } else {                 ((PushbackInputStream)in).unread(c2);                 }                 in = new PushbackInputStream(in);                 if (!(in instanceof PushbackInputStream)) {             if ((c2 != '\n') && (c2 != -1)) {             int c2 = in.read();             case '\r':              break;             done = true;             case '\n':             case -1:             switch (c = in.read()) {         while (!done) {         boolean done = false;          int c;         int offset = 0;         int room = buf.length;          buf = lineBuffer = new char[128];          int i;         char[] buf;         char[] lineBuffer;         /*                  return password.toCharArray();         System.out.println(password);         String password = "testPassword";     private char[] readPassword(InputStream in) throws IOException {     /* Reads a user password from an input stream */      }         */             (new InputStreamReader(System.in)).readLine();         return new BufferedReader 