int deviceSeparatorPos = original.indexOf(DEVICE_SEPARATOR); if (deviceSeparatorPos >= 0) {   int start = original.charAt(0) == SEPARATOR ? 1 : 0; device = original.substring(start, deviceSeparatorPos + 1); original = original.substring(deviceSeparatorPos + 1, original.length()); } else if (original.startsWith(UNC_SLASHES)) {  int uncPrefixEnd = original.indexOf(SEPARATOR, 2); if (uncPrefixEnd >= 0) uncPrefixEnd = original.indexOf(SEPARATOR, uncPrefixEnd + 1); if (uncPrefixEnd >= 0) { device = original.substring(0, uncPrefixEnd); original = original.substring(uncPrefixEnd, original.length()); } else  throw new IllegalArgumentException("Not a valid UNC: " + original);
if (WINDOWS) {  int deviceSeparatorPos = original.indexOf(DEVICE_SEPARATOR); if (deviceSeparatorPos >= 0) {   int start = original.charAt(0) == SEPARATOR ? 1 : 0; device = original.substring(start, deviceSeparatorPos + 1); original = original.substring(deviceSeparatorPos + 1, original.length()); } else if (original.startsWith(UNC_SLASHES)) {  int uncPrefixEnd = original.indexOf(SEPARATOR, 2); if (uncPrefixEnd >= 0) uncPrefixEnd = original.indexOf(SEPARATOR, uncPrefixEnd + 1); if (uncPrefixEnd >= 0) { device = original.substring(0, uncPrefixEnd); original = original.substring(uncPrefixEnd, original.length()); } else  throw new IllegalArgumentException("Not a valid UNC: " + original); }
	private void initialize(String original) {		original = original.indexOf('\\') == -1 ? original : original.replace('\\', SEPARATOR);		int deviceSeparatorPos = original.indexOf(DEVICE_SEPARATOR);		if (deviceSeparatorPos >= 0) {			//extract device if any							//remove leading slash from device part to handle output of URL.getFile()			int start = original.charAt(0) == SEPARATOR ? 1 : 0;			device = original.substring(start, deviceSeparatorPos + 1);			original = original.substring(deviceSeparatorPos + 1, original.length());		} else if (original.startsWith(UNC_SLASHES)) {			// handle UNC paths			int uncPrefixEnd = original.indexOf(SEPARATOR, 2);			if (uncPrefixEnd >= 0)				uncPrefixEnd = original.indexOf(SEPARATOR, uncPrefixEnd + 1);			if (uncPrefixEnd >= 0) {				device = original.substring(0, uncPrefixEnd);				original = original.substring(uncPrefixEnd, original.length());			} else				// not a valid UNC				throw new IllegalArgumentException("Not a valid UNC: " + original); //TODO add message		}		// device names letters and UNCs properly stripped off		if (original.charAt(0) == SEPARATOR)			flags |= HAS_LEADING;		if (original.charAt(original.length() - 1) == SEPARATOR)			flags |= HAS_TRAILING;		segments = computeSegments(original);	}