code: public static String appendSuffixIfMissing(String _str, String _suffix) {
          if (_str == null) {
              return null;
          }
          if (!_str.endsWith(_suffix)) {
              _str += _suffix;
          }
          return _str;
      }
docs: Append a suffix to the string (e.g. filename) if it doesn't have it already.
  @param _str string to check
  @param _suffix suffix to append
  @return string with suffix or original if no suffix was appended