java.net.URI#getRawUserInfo ( )源码实例Demo

下面列出了java.net.URI#getRawUserInfo ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: nano-framework   文件: URIBuilder.java
public URIBuilder digestURI(final URI uri) {
    this.scheme = uri.getScheme();
    this.encodedSchemeSpecificPart = uri.getRawSchemeSpecificPart();
    this.encodedAuthority = uri.getRawAuthority();
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.encodedUserInfo = uri.getRawUserInfo();
    this.userInfo = uri.getUserInfo();
    this.encodedPath = uri.getRawPath();
    this.path = uri.getPath();
    this.encodedQuery = uri.getRawQuery();
    this.queryParams = parseQuery(uri.getRawQuery());
    this.encodedFragment = uri.getRawFragment();
    this.fragment = uri.getFragment();
    return this;
}
 
源代码2 项目: es6draft   文件: SourceIdentifiers.java
private static boolean hasIllegalComponents(URI moduleName) {
    // All components except for 'path' must be empty.
    if (moduleName.getScheme() != null) {
        return true;
    }
    if (moduleName.getRawAuthority() != null) {
        return true;
    }
    if (moduleName.getRawUserInfo() != null) {
        return true;
    }
    if (moduleName.getHost() != null) {
        return true;
    }
    if (moduleName.getPort() != -1) {
        return true;
    }
    if (moduleName.getRawQuery() != null) {
        return true;
    }
    if (moduleName.getRawFragment() != null) {
        return true;
    }
    return false;
}
 
源代码3 项目: keycloak   文件: KeycloakUriBuilder.java
public KeycloakUriBuilder schemeSpecificPart(String ssp) throws IllegalArgumentException {
    if (ssp == null) throw new IllegalArgumentException("schemeSpecificPart was null");

    StringBuilder sb = new StringBuilder();
    if (scheme != null) sb.append(scheme).append(':');
    if (ssp != null)
        sb.append(ssp);
    if (fragment != null && fragment.length() > 0) sb.append('#').append(fragment);
    URI uri = URI.create(sb.toString());

    if (uri.getRawSchemeSpecificPart() != null && uri.getRawPath() == null) {
        this.ssp = uri.getRawSchemeSpecificPart();
    } else {
        this.ssp = null;
        userInfo = uri.getRawUserInfo();
        host = uri.getHost();
        port = uri.getPort();
        path = uri.getRawPath();
        query = uri.getRawQuery();

    }
    return this;

}
 
源代码4 项目: netcdf-java   文件: CdmS3Uri.java
@Nullable
private String getProfile(URI cdmUri) {
  String profile = null;
  if (cdmUri.getAuthority() != null) {
    profile = cdmUri.getRawUserInfo();
  }
  return profile;
}
 
源代码5 项目: java-cfenv   文件: UriInfo.java
private String[] parseUserinfo(URI uri) {
	String userInfo = uri.getRawUserInfo();

	if (userInfo != null) {
		String[] userPass = userInfo.split(":");
		if (userPass.length != 2) {
			throw new IllegalArgumentException("Bad userinfo in URI: " + uri);
		}
		return userPass;
	}

	return new String[]{null, null};
}
 
源代码6 项目: mirror   文件: ImplicitResponseUrl.java
ImplicitResponseUrl(URI uri) {
    this(uri.getScheme(),
            uri.getHost(),
            uri.getPort(),
            uri.getRawPath(),
            uri.getRawFragment(),
            uri.getRawQuery(),
            uri.getRawUserInfo());
}
 
源代码7 项目: BigApp_Discuz_Android   文件: URIBuilder.java
private void digestURI(final URI uri) {
    this.scheme = uri.getScheme();
    this.encodedSchemeSpecificPart = uri.getRawSchemeSpecificPart();
    this.encodedAuthority = uri.getRawAuthority();
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.encodedUserInfo = uri.getRawUserInfo();
    this.userInfo = uri.getUserInfo();
    this.encodedPath = uri.getRawPath();
    this.path = uri.getPath();
    this.encodedQuery = uri.getRawQuery();
    this.queryParams = parseQuery(uri.getRawQuery());
    this.encodedFragment = uri.getRawFragment();
    this.fragment = uri.getFragment();
}
 
源代码8 项目: jrestless   文件: CorsFilter.java
private static boolean isValidOrigin(URI origin) {
	return origin != null
			&& origin.getScheme() != null
			&& origin.getHost() != null
			&& isBlank(origin.getRawPath())
			&& origin.getRawQuery() == null
			&& origin.getRawFragment() == null
			&& origin.getRawUserInfo() == null;
}
 
ImplicitResponseUrl(URI uri) {
    this(uri.getScheme(),
            uri.getHost(),
            uri.getPort(),
            uri.getRawPath(),
            uri.getRawFragment(),
            uri.getRawQuery(),
            uri.getRawUserInfo());
}
 
源代码10 项目: google-http-java-client   文件: GenericUrl.java
/**
 * Constructs from a URI.
 *
 * @param uri URI
 * @param verbatim flag, to specify if URL should be used as is (without encoding, decoding and
 *     escaping)
 */
public GenericUrl(URI uri, boolean verbatim) {
  this(
      uri.getScheme(),
      uri.getHost(),
      uri.getPort(),
      uri.getRawPath(),
      uri.getRawFragment(),
      uri.getRawQuery(),
      uri.getRawUserInfo(),
      verbatim);
}
 
源代码11 项目: jackrabbit-filevault   文件: RepositoryAddress.java
/**
 * {@inheritDoc}
 *
 * @return same as {@link #getURI() getURI().toString()} with obfuscated user info
 */
@Override
@NotNull
public String toString() {
    final URI uri = getURI();
    final String userInfo = uri.getRawUserInfo();
    if (userInfo != null) {
        return uri.toString().replace(userInfo, "******:******");
    } else {
        return uri.toString();
    }
}
 
源代码12 项目: android-open-project-demo   文件: URIBuilder.java
private void digestURI(final URI uri) {
    this.scheme = uri.getScheme();
    this.encodedSchemeSpecificPart = uri.getRawSchemeSpecificPart();
    this.encodedAuthority = uri.getRawAuthority();
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.encodedUserInfo = uri.getRawUserInfo();
    this.userInfo = uri.getUserInfo();
    this.encodedPath = uri.getRawPath();
    this.path = uri.getPath();
    this.encodedQuery = uri.getRawQuery();
    this.queryParams = parseQuery(uri.getRawQuery());
    this.encodedFragment = uri.getRawFragment();
    this.fragment = uri.getFragment();
}
 
源代码13 项目: plugin-socket.io   文件: Url.java
public static URL parse(URI uri) throws MalformedURLException {
    String protocol = uri.getScheme();
    if (protocol == null || !protocol.matches("^https?|wss?$")) {
        protocol = "https";
    }

    int port = uri.getPort();
    if (port == -1) {
        if (PATTERN_HTTP.matcher(protocol).matches()) {
            port = 80;
        } else if (PATTERN_HTTPS.matcher(protocol).matches()) {
            port = 443;
        }
    }

    String path = uri.getRawPath();
    if (path == null || path.length() == 0) {
        path = "/";
    }

    String userInfo = uri.getRawUserInfo();
    String query = uri.getRawQuery();
    String fragment = uri.getRawFragment();
    return new URL(protocol + "://"
            + (userInfo != null ? userInfo + "@" : "")
            + uri.getHost()
            + (port != -1 ? ":" + port : "")
            + path
            + (query != null ? "?" + query : "")
            + (fragment != null ? "#" + fragment : ""));
}
 
源代码14 项目: plugin-socket.io   文件: Url.java
public static URL parse(URI uri) throws MalformedURLException {
    String protocol = uri.getScheme();
    if (protocol == null || !protocol.matches("^https?|wss?$")) {
        protocol = "https";
    }

    int port = uri.getPort();
    if (port == -1) {
        if (PATTERN_HTTP.matcher(protocol).matches()) {
            port = 80;
        } else if (PATTERN_HTTPS.matcher(protocol).matches()) {
            port = 443;
        }
    }

    String path = uri.getRawPath();
    if (path == null || path.length() == 0) {
        path = "/";
    }

    String userInfo = uri.getRawUserInfo();
    String query = uri.getRawQuery();
    String fragment = uri.getRawFragment();
    return new URL(protocol + "://"
            + (userInfo != null ? userInfo + "@" : "")
            + uri.getHost()
            + (port != -1 ? ":" + port : "")
            + path
            + (query != null ? "?" + query : "")
            + (fragment != null ? "#" + fragment : ""));
}
 
源代码15 项目: spring-cloud-connectors   文件: UriInfo.java
private String[] parseUserinfo(URI uri) {
	String userInfo = uri.getRawUserInfo();

	if (userInfo != null) {
		String[] userPass = userInfo.split(":");
		if (userPass.length == 1) {
			return new String[]{userPass[0], null};
		} else if (userPass.length != 2) {
			throw new IllegalArgumentException("Bad userinfo in URI: " + uri);
		}
		return userPass;
	}

	return new String[]{null, null};
}
 
源代码16 项目: RoboZombie   文件: URIBuilder.java
private void digestURI(final URI uri) {
    this.scheme = uri.getScheme();
    this.encodedSchemeSpecificPart = uri.getRawSchemeSpecificPart();
    this.encodedAuthority = uri.getRawAuthority();
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.encodedUserInfo = uri.getRawUserInfo();
    this.userInfo = uri.getUserInfo();
    this.encodedPath = uri.getRawPath();
    this.path = uri.getPath();
    this.encodedQuery = uri.getRawQuery();
    this.queryParams = parseQuery(uri.getRawQuery(), Consts.UTF_8);
    this.encodedFragment = uri.getRawFragment();
    this.fragment = uri.getFragment();
}
 
源代码17 项目: netbeans   文件: HgURL.java
/**
 *
 * @param urlString
 * @param username
 * @param password value is cloned, if you want to null the field, call {@link #clearPassword()}
 * @throws URISyntaxException
 */
public HgURL(String urlString, String username, char[] password) throws URISyntaxException {
    URI originalUri;

    if (urlString == null) {
        throw new IllegalArgumentException("<null> URL string");    //NOI18N
    }

    if (urlString.length() == 0) {
        throw new IllegalArgumentException("empty URL string");     //NOI18N
    }

    if (looksLikePlainFilePath(urlString)) {
        originalUri = new File(urlString).toURI();
        scheme = Scheme.FILE;
    } else {
        originalUri = new URI(urlString).parseServerAuthority();
        String originalScheme = originalUri.getScheme();
        scheme = (originalScheme != null) ? determineScheme(originalScheme)
                                          : null;
    }

    if (scheme == null) {
        throw new URISyntaxException(
                urlString,
                NbBundle.getMessage(HgURL.class,
                                    "MSG_UNSUPPORTED_PROTOCOL",     //NOI18N
                                    originalUri.getScheme()));
    }

    verifyUserInfoData(scheme, username, password);

    if (username != null) {
        this.username = username;
        this.password = password == null ? null : (char[])password.clone();
    } else {
        String rawUserInfo = originalUri.getRawUserInfo();
        if (rawUserInfo == null) {
            this.username = null;
            this.password = null;
        } else {
            int colonIndex = rawUserInfo.indexOf(':');
            if (colonIndex == -1) {
                this.username = rawUserInfo;
                this.password = null;
            } else {
                this.username = rawUserInfo.substring(0, colonIndex);
                this.password = rawUserInfo.substring(colonIndex + 1).toCharArray();
            }
        }
    }

    host = originalUri.getHost();
    port = originalUri.getPort();
    rawPath     = originalUri.getRawPath();
    rawQuery    = originalUri.getRawQuery();
    rawFragment = originalUri.getRawFragment();

    path = originalUri.getPath();
}
 
源代码18 项目: emodb   文件: EmoUriBuilder.java
@Override
public UriBuilder schemeSpecificPart(String ssp) {
    if (ssp == null) {
        throw new IllegalArgumentException("Scheme specific part parameter is null");
    }

    // TODO encode or validate scheme specific part
    // This will not work for template variables present in the spp
    StringBuilder sb = new StringBuilder();
    if (scheme != null) {
        sb.append(scheme).append(':');
    }
    if (ssp != null) {
        sb.append(ssp);
    }
    if (fragment != null && fragment.length() > 0) {
        sb.append('#').append(fragment);
    }
    URI uri = createURI(sb.toString());

    if (uri.getRawSchemeSpecificPart() != null && uri.getRawPath() == null) {
        this.ssp = uri.getRawSchemeSpecificPart();
    } else {
        this.ssp = null;

        if (uri.getRawAuthority() != null) {
            if (uri.getRawUserInfo() == null && uri.getHost() == null && uri.getPort() == -1) {
                authority = uri.getRawAuthority();
                userInfo = null;
                host = null;
                port = -1;
            } else {
                authority = null;
                userInfo = uri.getRawUserInfo();
                host = uri.getHost();
                port = uri.getPort();
            }
        }

        path.setLength(0);
        path.append(replaceNull(uri.getRawPath()));

        query.setLength(0);
        query.append(replaceNull(uri.getRawQuery()));
    }
    return this;
}
 
源代码19 项目: CloverETL-Engine   文件: AbstractAuthority.java
/**
 * use {@link URI#getRawUserInfo()} so the user info is not decoded - connections decode it again, which
 * causes problems with the plus sign, see CLO-8885
 */
public AbstractAuthority(URI uri) {
	this(uri.getScheme(), uri.getRawUserInfo(), uri.getHost(), uri.getPort());
}
 
源代码20 项目: CloverETL-Engine   文件: DefaultAuthority.java
/**
 * use {@link URI#getRawUserInfo()} so the user info is not decoded - connections decode it again, which
 * causes problems with the plus sign, see CLO-8885
 */
public DefaultAuthority(URI uri, String proxy) {
	this(uri.getScheme(), uri.getRawUserInfo(), uri.getHost(), uri.getPort(), proxy);
}