vertx/src/main/java/eu/internetofus/common/vertx/ComponentClient.java
/**
   * Create the absolute URL to a path of the component.
   *
   * @param paths to the component.
   *
   * @return the absolute URL to component path.
   */
Create the absolute URL to a path of the component.
@param paths to the component.

@return the absolute URL to component path.
Create the absolute URL to a path of the component . @param paths to the component . @return the absolute URL to component path .
protected String createAbsoluteUrlWith(final Object... paths) {
    final var builder = new StringBuilder();
    builder.append(this.componentURL);
    for (final Object path : paths) {
      final var pathSegment = String.valueOf(path);
      final var max = pathSegment.length();
      if (max > 0 && pathSegment.charAt(0) != '/' && builder.charAt(builder.length() - 1) != '/') {
        builder.append('/');
      }
      for (var i = 0; i < max; i++) {
        final var c = pathSegment.charAt(i);
        if (Character.isLetterOrDigit(c) || c == '-' || c == '.' || c == '_' || c == '~') {
          builder.append(c);
        } else if (c == '/') {
          if (builder.charAt(builder.length() - 1) != '/') {
            builder.append(c);
          } 
        } else {
          final var bytes = String.valueOf(c).getBytes(Charset.defaultCharset());
          for (final byte b : bytes) {
            builder.append('%');
            builder.append(Integer.toHexString(b >> 4 & 0xf));
            builder.append(Integer.toHexString(b & 0xf));
          }
        }
      }
    }
    return builder.toString();
  }
protected String createAbsoluteUrlWith ( final Object ... paths ) { final var builder = new StringBuilder ( ) ; builder . append ( this . componentURL ) ; for ( final Object path : paths ) { final var pathSegment = String . valueOf ( path ) ; final var max = pathSegment . length ( ) ; if ( max > 0 && pathSegment . charAt ( 0 ) != '/' && builder . charAt ( builder . length ( ) - 1 ) != '/' ) { builder . append ( '/' ) ; } for ( var i = 0 ; i < max ; i ++ ) { final var c = pathSegment . charAt ( i ) ; if ( Character . isLetterOrDigit ( c ) || c == '-' || c == '.' || c == '_' || c == '~' ) { builder . append ( c ) ; } else if ( c == '/' ) { if ( builder . charAt ( builder . length ( ) - 1 ) != '/' ) { builder . append ( c ) ; } } else { final var bytes = String . valueOf ( c ) . getBytes ( Charset . defaultCharset ( ) ) ; for ( final byte b : bytes ) { builder . append ( '%' ) ; builder . append ( Integer . toHexString ( b >> 4 & 0xf ) ) ; builder . append ( Integer . toHexString ( b & 0xf ) ) ; } } } } return builder . toString ( ) ; }
Create the absolute URL to a path of the component.
Create the absolute URL to a path of the component .
// else ignored