private static String validateAndGetNameInPath(String path) {
    if (path == null || !path.startsWith("/")) {
      return null;
    }
    // path is "/name", so remove leading "/", and trailing white spaces
    String name = path.substring(1).trim();
    if (name.length() == 0) {
      return null; // only white spaces.
    }
    return name;
  }
Parses a secret value from a URI. The format will be:

<p>otpauth://totp/user@example.com?secret=FFF...

<p>otpauth://hotp/user@example.com?secret=FFF...&counter=123

@param uri The URI containing the secret key
@param confirmBeforeSave a boolean to indicate if the user should be prompted for confirmation
    before updating the otp account information.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java