private static String decode(final String str) {
    if (str == null) {
      return null;
    }

    for (int i = 0; i < str.length(); ++i) {
      if (str.charAt(i) == '%') {
        return decode(str, i);
      }
    }

    return str;
  }
Percent-decodes the given string, with a fast path for strings that
are not percent-encoded.

@param str the string to decode
@return the decoded string
src/main/java/com/creactiviti/piper/taskhandler/s3/AmazonS3URI.java