try { if (args.length < 2) { System.out.println("Usage: RA deluser <username>"); return; } String username = args[1]; System.out.print("Have you revoked the user [y/N]? "); int inp = System.in.read(); if ( (inp == 121) || (inp==89) ) { try{ getAdminSession().deleteUser(username); System.out.println("Deleted user "+username); }catch(AuthorizationDeniedException e){ System.out.println("Error : Not authorized to remove user."); } } else { System.out.println("Delete aborted!"); System.out.println("Please run 'ra revokeuser "+username+"'."); } } catch (Exception e) { throw new ErrorAdminCommandException(e); }
if (args.length < 2) { throw new IllegalAdminCommandException("Usage: RA deluser <username>"); } try { String username = args[1]; System.out.print("Have you revoked the user [y/N]? "); int inp = System.in.read(); if ((inp == 121) || (inp == 89)) { try { getAdminSession().deleteUser(username); System.out.println("Deleted user " + username); } catch (AuthorizationDeniedException e) { System.out.println( "Error : Not authorized to remove user."); } } else { System.out.println("Delete aborted!"); System.out.println( "Please run 'ra revokeuser " + username + "'."); } } catch (Exception e) { throw new ErrorAdminCommandException(e); }
    public void execute() throws IllegalAdminCommandException, ErrorAdminCommandException {        try {            if (args.length < 2) {                System.out.println("Usage: RA deluser <username>");                return;            }            String username = args[1];            System.out.print("Have you revoked the user [y/N]? ");            int inp = System.in.read();            if ( (inp == 121) || (inp==89) ) {              try{                getAdminSession().deleteUser(username);                System.out.println("Deleted user "+username);              }catch(AuthorizationDeniedException e){               System.out.println("Error : Not authorized to remove user.");               }              } else {                System.out.println("Delete aborted!");                System.out.println("Please run 'ra revokeuser "+username+"'.");            }        } catch (Exception e) {            throw new ErrorAdminCommandException(e);        }    } // execute