code: private static String stripTrailingSlash(String s) {
          if (s != null && s.endsWith("/")) {
              s = s.substring(0, s.length() - 1);
          }
          return s;
      }
docs: Strip trailing slash from end of string.