@Override public SourceURL get(Context ctx, Data item) throws Exception { Serializable s = r.get(ctx, item); return (s == null) ? null : new SourceURL(s.toString()); }
private SourceURL createUrl(String fileName) throws Exception { String urlString = url.getProtocol() + ":" + url.getPath() + "/" + fileName; return new SourceURL(urlString); }
private SourceURL createUrl(String fileName) throws Exception { String urlString = url.getProtocol() + ":" + url.getPath() + "/" + fileName; return new SourceURL(urlString); }
SourceURL sourceUrl = null; if (params.get("url") != null) { sourceUrl = new SourceURL(params.get("url"));
public static void main(String[] args) throws Exception { SourceURL source = new SourceURL(args[0]); BobStream stream = new BobStream(source); stream.init(); long start = System.currentTimeMillis(); long bytesRead = 0L; Data item = stream.read(); while (item != null) { byte[] block = (byte[]) item.get("data"); bytesRead += (12 + block.length); item = stream.read(); } long end = System.currentTimeMillis(); Double secs = (end - start * 1.0d) / 1000.0d; Double dataRate = (bytesRead / 1024 / 1024) / secs; stream.close(); DecimalFormat fmt = new DecimalFormat("0.0"); log.info("Read {} bytes, ({} MB/sec)", bytesRead, fmt.format(dataRate)); } }
SourceURL src = new SourceURL(args[0]); log.info("Ttying to read configuration from {}", src); xml = XMLUtils.parseDocument(src.openStream());
public static void main(String[] args) throws Exception { SourceURL source = new SourceURL(args[0]); BobStream stream = new BobStream(source); stream.init(); long start = System.currentTimeMillis(); long bytesRead = 0L; Data item = stream.read(); while (item != null) { byte[] block = (byte[]) item.get("data"); bytesRead += (12 + block.length); item = stream.read(); } long end = System.currentTimeMillis(); Double secs = (end - start * 1.0d) / 1000.0d; Double dataRate = (bytesRead / 1024 / 1024) / secs; stream.close(); DecimalFormat fmt = new DecimalFormat("0.0"); log.info("Read {} bytes, ({} MB/sec)", bytesRead, fmt.format(dataRate)); } }
public SSLConnection(SourceURL url) throws Exception { super(url); this.host = url.getHost(); this.port = url.getPort(); if (url.getParameters().containsKey("keystorePassword")) this.password = url.getParameters().get("keystorePassword") .toCharArray(); else this.password = null; if (url.getParameters().containsKey("keystoreUrl")) { SourceURL ksUrl = new SourceURL(url.getParameters().get( "keystoreUrl")); loadKeyStore(ksUrl, password); } else this.keyStore = null; if (url.getParameters().containsKey("truststoreUrl")) { this.trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); SourceURL tsUrl = new SourceURL(url.getParameters().get( "truststoreUrl")); String trustpw = url.getParameters().get("truststorePassword"); if (trustpw == null) { trustpw = new String(password); } loadTrustStore(tsUrl, trustpw.toCharArray()); } else { this.trustStore = this.keyStore; } }
log.debug("Properties URL is: {}", purl); SourceURL propUrl = new SourceURL(purl);
public SSLConnection(SourceURL url) throws Exception { super(url); this.host = url.getHost(); this.port = url.getPort(); if (url.getParameters().containsKey("keystorePassword")) this.password = url.getParameters().get("keystorePassword") .toCharArray(); else this.password = null; if (url.getParameters().containsKey("keystoreUrl")) { SourceURL ksUrl = new SourceURL(url.getParameters().get( "keystoreUrl")); loadKeyStore(ksUrl, password); } else this.keyStore = null; if (url.getParameters().containsKey("truststoreUrl")) { this.trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); SourceURL tsUrl = new SourceURL(url.getParameters().get( "truststoreUrl")); String trustpw = url.getParameters().get("truststorePassword"); if (trustpw == null) { trustpw = new String(password); } loadTrustStore(tsUrl, trustpw.toCharArray()); } else { this.trustStore = this.keyStore; } }
if (url != null && !url.trim().isEmpty()) { log.debug("Found xinclude for URL {}", url); SourceURL source = new SourceURL(url); log.debug("reading document from {}", source); included = XMLUtils.parseDocument(source.openStream());
SourceURL source = new SourceURL(url); log.debug("reading document from {}", source);