/** * Subclasses can override these method to construct alternate * subclasses of ParsedURLData. * @param url the java.net.URL class we reference. */ protected ParsedURLData constructParsedURLData(URL url) { return new ParsedURLData(url); }
/** * Subclasses can override these method to construct alternate * subclasses of ParsedURLData. */ protected ParsedURLData constructParsedURLData() { return new ParsedURLData(); }
/** * Subclasses can override these method to construct alternate * subclasses of ParsedURLData. * @param url the java.net.URL class we reference. */ protected ParsedURLData constructParsedURLData(URL url) { return new ParsedURLData(url); }
/** * Subclasses can override these method to construct alternate * subclasses of ParsedURLData. */ protected ParsedURLData constructParsedURLData() { return new ParsedURLData(); }
/** * Subclasses can override these method to construct alternate * subclasses of ParsedURLData. */ protected ParsedURLData constructParsedURLData() { return new ParsedURLData(); }
/** * Subclasses can override these method to construct alternate * subclasses of ParsedURLData. * @param url the java.net.URL class we reference. */ protected ParsedURLData constructParsedURLData(URL url) { return new ParsedURLData(url); }
/** * Construct a ParsedURL from the given java.net.URL instance. * This is useful if you already have a valid java.net.URL * instance. This bypasses most of the parsing and hence is * quicker and less prone to reinterpretation than converting the * URL to a string before construction. * * @param url The URL to "mimic". */ public ParsedURL(URL url) { userAgent = getGlobalUserAgent(); data = new ParsedURLData(url); }
/** * Construct a ParsedURL from the given java.net.URL instance. * This is useful if you already have a valid java.net.URL * instance. This bypasses most of the parsing and hence is * quicker and less prone to reinterpretation than converting the * URL to a string before construction. * * @param url The URL to "mimic". */ public ParsedURL(URL url) { userAgent = getGlobalUserAgent(); data = new ParsedURLData(url); }
/** * Getbase.getPath() the ParsedURLData for the context. Absolute URIs are specified like * "resource://". */ public ParsedURLData parseURL(String uri) { ParsedURLData urldata = null; String path = uri.substring("resource:/".length()); urldata = new ParsedURLData(Thread.currentThread().getContextClassLoader().getResource(path)); if ("file".equals(urldata.protocol)) { urldata.host = null; urldata.port = -1; } else if (null == urldata.host) { urldata.port = -1; } else if (urldata.port < 0) { urldata.host = null; } return urldata; }
/** * Construct a ParsedURL from the given java.net.URL instance. * This is useful if you already have a valid java.net.URL * instance. This bypasses most of the parsing and hence is * quicker and less prone to reinterpretation than converting the * URL to a string before construction. * * @param url The URL to "mimic". */ public ParsedURL(URL url) { userAgent = getGlobalUserAgent(); data = new ParsedURLData(url); }
try { String path = uri.substring("context:/".length()); urldata = new ParsedURLData(ParsedContextURLProtocolHandler.context.getResource(path)); } catch (MalformedURLException mue) { StringBuffer baseFile = new StringBuffer(ParsedContextURLProtocolHandler baseFile.append(uri.substring("context://".length())); urldata = new ParsedURLData(); urldata.protocol = "file"; urldata.path = baseFile.toString();