/** * Factory method to construct an appropriate subclass of ParsedURLData * @param urlStr the string to parse. */ public static ParsedURLData parseURL(String urlStr) { if (urlStr != null && !urlStr.contains(":") && !urlStr.startsWith("#")) { // an URL needs a protocol; default to file:// if none set urlStr = "file:" + urlStr; } ParsedURLProtocolHandler handler = getHandler(getProtocol(urlStr)); return handler.parseURL(urlStr); }
/** * Factory method to construct an appropriate subclass of ParsedURLData * @param urlStr the string to parse. */ public static ParsedURLData parseURL(String urlStr) { if (urlStr != null && !urlStr.contains(":") && !urlStr.startsWith("#")) { // an URL needs a protocol; default to file:// if none set urlStr = "file:" + urlStr; } ParsedURLProtocolHandler handler = getHandler(getProtocol(urlStr)); return handler.parseURL(urlStr); }
/** * Factory method to construct an appropriate subclass of ParsedURLData * @param urlStr the string to parse. */ public static ParsedURLData parseURL(String urlStr) { if (urlStr != null && !urlStr.contains(":") && !urlStr.startsWith("#")) { // an URL needs a protocol; default to file:// if none set urlStr = "file:" + urlStr; } ParsedURLProtocolHandler handler = getHandler(getProtocol(urlStr)); return handler.parseURL(urlStr); }
/** * Factory method to construct an appropriate subclass of ParsedURLData, * for a sub url. * @param baseURL The base ParsedURL to parse. * @param urlStr the sub URL string to parse. */ public static ParsedURLData parseURL(ParsedURL baseURL, String urlStr) { if (baseURL == null) return parseURL(urlStr); String protocol = getProtocol(urlStr); if (protocol == null) protocol = baseURL.getProtocol(); ParsedURLProtocolHandler handler = getHandler(protocol); return handler.parseURL(baseURL, urlStr); } }
/** * Factory method to construct an appropriate subclass of ParsedURLData, * for a sub url. * @param baseURL The base ParsedURL to parse. * @param urlStr the sub URL string to parse. */ public static ParsedURLData parseURL(ParsedURL baseURL, String urlStr) { if (baseURL == null) return parseURL(urlStr); String protocol = getProtocol(urlStr); if (protocol == null) protocol = baseURL.getProtocol(); ParsedURLProtocolHandler handler = getHandler(protocol); return handler.parseURL(baseURL, urlStr); } }
/** * Factory method to construct an appropriate subclass of ParsedURLData, * for a sub url. * @param baseURL The base ParsedURL to parse. * @param urlStr the sub URL string to parse. */ public static ParsedURLData parseURL(ParsedURL baseURL, String urlStr) { if (baseURL == null) return parseURL(urlStr); String protocol = getProtocol(urlStr); if (protocol == null) protocol = baseURL.getProtocol(); ParsedURLProtocolHandler handler = getHandler(protocol); return handler.parseURL(baseURL, urlStr); } }