private String validateScheme(String uri, int end) throws URISyntaxException { if (end == 0) { throw new URISyntaxException(uri, "Scheme expected", 0); } for (int i = 0; i < end; i++) { if (!UrlUtils.isValidSchemeChar(i, uri.charAt(i))) { throw new URISyntaxException(uri, "Illegal character in scheme", 0); } } return uri.substring(0, end); }
/** * Returns the scheme prefix like "http" from the URL spec, or null if the * spec doesn't start with a scheme. Scheme prefixes match this pattern: * {@code alpha ( alpha | digit | '+' | '-' | '.' )* ':'} */ public static String getSchemePrefix(String spec) { int colon = spec.indexOf(':'); if (colon < 1) { return null; } for (int i = 0; i < colon; i++) { char c = spec.charAt(i); if (!isValidSchemeChar(i, c)) { return null; } } return spec.substring(0, colon).toLowerCase(Locale.US); }
private String validateScheme(String uri, int end) throws URISyntaxException { if (end == 0) { throw new URISyntaxException(uri, "Scheme expected", 0); } for (int i = 0; i < end; i++) { if (!UrlUtils.isValidSchemeChar(i, uri.charAt(i))) { throw new URISyntaxException(uri, "Illegal character in scheme", 0); } } return uri.substring(0, end); }
private String validateScheme(String uri, int end) throws URISyntaxException { if (end == 0) { throw new URISyntaxException(uri, "Scheme expected", 0); } for (int i = 0; i < end; i++) { if (!UrlUtils.isValidSchemeChar(i, uri.charAt(i))) { throw new URISyntaxException(uri, "Illegal character in scheme", 0); } } return uri.substring(0, end); }
private String validateScheme(String uri, int end) throws URISyntaxException { if (end == 0) { throw new URISyntaxException(uri, "Scheme expected", 0); } for (int i = 0; i < end; i++) { if (!UrlUtils.isValidSchemeChar(i, uri.charAt(i))) { throw new URISyntaxException(uri, "Illegal character in scheme", 0); } } return uri.substring(0, end); }
private String validateScheme(String uri, int end) throws URISyntaxException { if (end == 0) { throw new URISyntaxException(uri, "Scheme expected", 0); } for (int i = 0; i < end; i++) { if (!UrlUtils.isValidSchemeChar(i, uri.charAt(i))) { throw new URISyntaxException(uri, "Illegal character in scheme", 0); } } return uri.substring(0, end); }
private String validateScheme(String uri, int end) throws URISyntaxException { if (end == 0) { throw new URISyntaxException(uri, "Scheme expected", 0); } for (int i = 0; i < end; i++) { if (!UrlUtils.isValidSchemeChar(i, uri.charAt(i))) { throw new URISyntaxException(uri, "Illegal character in scheme", 0); } } return uri.substring(0, end); }
private String validateScheme(String uri, int end) throws URISyntaxException { if (end == 0) { throw new URISyntaxException(uri, "Scheme expected", 0); } for (int i = 0; i < end; i++) { if (!UrlUtils.isValidSchemeChar(i, uri.charAt(i))) { throw new URISyntaxException(uri, "Illegal character in scheme", 0); } } return uri.substring(0, end); }
/** * Returns the scheme prefix like "http" from the URL spec, or null if the * spec doesn't start with a scheme. Scheme prefixes match this pattern: * {@code alpha ( alpha | digit | '+' | '-' | '.' )* ':'} */ public static String getSchemePrefix(String spec) { int colon = spec.indexOf(':'); if (colon < 1) { return null; } for (int i = 0; i < colon; i++) { char c = spec.charAt(i); if (!isValidSchemeChar(i, c)) { return null; } } return spec.substring(0, colon).toLowerCase(Locale.US); }
/** * Returns the scheme prefix like "http" from the URL spec, or null if the * spec doesn't start with a scheme. Scheme prefixes match this pattern: * {@code alpha ( alpha | digit | '+' | '-' | '.' )* ':'} */ public static String getSchemePrefix(String spec) { int colon = spec.indexOf(':'); if (colon < 1) { return null; } for (int i = 0; i < colon; i++) { char c = spec.charAt(i); if (!isValidSchemeChar(i, c)) { return null; } } return spec.substring(0, colon).toLowerCase(Locale.US); }
/** * Returns the scheme prefix like "http" from the URL spec, or null if the * spec doesn't start with a scheme. Scheme prefixes match this pattern: * {@code alpha ( alpha | digit | '+' | '-' | '.' )* ':'} */ public static String getSchemePrefix(String spec) { int colon = spec.indexOf(':'); if (colon < 1) { return null; } for (int i = 0; i < colon; i++) { char c = spec.charAt(i); if (!isValidSchemeChar(i, c)) { return null; } } return spec.substring(0, colon).toLowerCase(Locale.US); }
/** * Returns the scheme prefix like "http" from the URL spec, or null if the * spec doesn't start with a scheme. Scheme prefixes match this pattern: * {@code alpha ( alpha | digit | '+' | '-' | '.' )* ':'} */ public static String getSchemePrefix(String spec) { int colon = spec.indexOf(':'); if (colon < 1) { return null; } for (int i = 0; i < colon; i++) { char c = spec.charAt(i); if (!isValidSchemeChar(i, c)) { return null; } } return spec.substring(0, colon).toLowerCase(Locale.US); }
/** * Returns the scheme prefix like "http" from the URL spec, or null if the * spec doesn't start with a scheme. Scheme prefixes match this pattern: * {@code alpha ( alpha | digit | '+' | '-' | '.' )* ':'} */ public static String getSchemePrefix(String spec) { int colon = spec.indexOf(':'); if (colon < 1) { return null; } for (int i = 0; i < colon; i++) { char c = spec.charAt(i); if (!isValidSchemeChar(i, c)) { return null; } } return spec.substring(0, colon).toLowerCase(Locale.US); }
/** * Returns the scheme prefix like "http" from the URL spec, or null if the * spec doesn't start with a scheme. Scheme prefixes match this pattern: * {@code alpha ( alpha | digit | '+' | '-' | '.' )* ':'} */ public static String getSchemePrefix(String spec) { int colon = spec.indexOf(':'); if (colon < 1) { return null; } for (int i = 0; i < colon; i++) { char c = spec.charAt(i); if (!isValidSchemeChar(i, c)) { return null; } } return spec.substring(0, colon).toLowerCase(Locale.US); }