text: 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);}