src/main/java/de/qaware/xff/util/uri/UriComponentsBuilder.java
/**
     * Initialize components of this builder from components of the given URI.
     *
     * @param uri the URI
     * @return this UriComponentsBuilder
     */
Initialize components of this builder from components of the given URI.
@param uri the URI
@return this UriComponentsBuilder
Initialize components of this builder from components of the given URI . @param uri the URI @return this UriComponentsBuilder
public UriComponentsBuilder uri(URI uri) {
        Validate.notNull(uri, "URI must not be null");
        this.scheme = uri.getScheme();
        if (uri.isOpaque()) {
            this.ssp = uri.getRawSchemeSpecificPart();
            resetHierarchicalComponents();
        } else {
            if (uri.getRawUserInfo() != null) {
                this.userInfo = uri.getRawUserInfo();
            }
            if (uri.getHost() != null) {
                this.host = uri.getHost();
            }
            if (uri.getPort() != -1) {
                this.port = String.valueOf(uri.getPort());
            }
            if (StringUtils.isNotEmpty(uri.getRawPath())) {
                this.pathBuilder = new CompositePathComponentBuilder();
                this.pathBuilder.addPath(uri.getRawPath());
            }
            if (StringUtils.isNotEmpty(uri.getRawQuery())) {
                this.queryParams.clear();
                query(uri.getRawQuery());
            }
            resetSchemeSpecificPart();
        }
        if (uri.getRawFragment() != null) {
            this.fragment = uri.getRawFragment();
        }
        return this;
    }
public UriComponentsBuilder uri ( URI uri ) { Validate . notNull ( uri , "URI must not be null" ) ; this . scheme = uri . getScheme ( ) ; if ( uri . isOpaque ( ) ) { this . ssp = uri . getRawSchemeSpecificPart ( ) ; resetHierarchicalComponents ( ) ; } else { if ( uri . getRawUserInfo ( ) != null ) { this . userInfo = uri . getRawUserInfo ( ) ; } if ( uri . getHost ( ) != null ) { this . host = uri . getHost ( ) ; } if ( uri . getPort ( ) != - 1 ) { this . port = String . valueOf ( uri . getPort ( ) ) ; } if ( StringUtils . isNotEmpty ( uri . getRawPath ( ) ) ) { this . pathBuilder = new CompositePathComponentBuilder ( ) ; this . pathBuilder . addPath ( uri . getRawPath ( ) ) ; } if ( StringUtils . isNotEmpty ( uri . getRawQuery ( ) ) ) { this . queryParams . clear ( ) ; query ( uri . getRawQuery ( ) ) ; } resetSchemeSpecificPart ( ) ; } if ( uri . getRawFragment ( ) != null ) { this . fragment = uri . getRawFragment ( ) ; } return this ; }
Initialize components of this builder from components of the given URI.
Initialize components of this builder from components of the given URI .