code: public static byte[] decodeUrl(final String arg) throws Exception {
  
          String s = arg;
          s = s.replace('-', '+'); // 62nd char of encoding
          s = s.replace('_', '/'); // 63rd char of encoding
          switch (s.length() % 4) // Pad with trailing '='s
          {
          case 0:
              break; // No pad chars in this case
          case 2:
              s += "==";
              break; // Two pad chars
          case 3:
              s += "=";
              break; // One pad char
          default:
              throw new java.lang.Exception("Illegal base64url string!");
          }
          return Base64Util.decode(s);
      }
docs: end decode