示例#1
0
 public void runRemoveUser() {
   int userId;
   String arg = nextArg();
   if (arg == null) {
     System.err.println("Error: no user id specified.");
     return;
   }
   try {
     userId = Integer.parseInt(arg);
   } catch (NumberFormatException e) {
     System.err.println("Error: user id '" + arg + "' is not a number.");
     return;
   }
   try {
     if (mUm.removeUser(userId)) {
       System.out.println("Success: removed user");
     } else {
       System.err.println("Error: couldn't remove user id " + userId);
     }
   } catch (RemoteException e) {
     System.err.println(e.toString());
     System.err.println(PM_NOT_RUNNING_ERR);
   }
 }