code: private static int parseInt(final String str) throws BOSHException {
          try {
              return Integer.parseInt(str);
          } catch (NumberFormatException nfx) {
              throw(new BOSHException(
                      "Could not parse an integer from the value provided: "
                      + str,
                      nfx));
          }
      }
docs: Utility method to parse a {@code String} into an {@code Integer},
  converting any possible {@code NumberFormatException} thrown into
  a {@code BOSHException}.
  
  @param str string to parse
  @return integer value
  @throws BOSHException on {@code NumberFormatException}