/** * @see stream.io.SourceURL#getParameters() */ @Override public Map<String, String> getParameters() { return super.getParameters(); } }
/** * @see stream.io.SourceURL#getParameters() */ @Override public Map<String, String> getParameters() { return super.getParameters(); } }
/** * @see stream.urls.Connection#connect() */ @Override public InputStream connect() throws IOException { boolean removeAfterRead = "true".equalsIgnoreCase(url.getParameters() .get("remove")); String pattern = ".*"; if (url.getParameters().containsKey("pattern")) { pattern = url.getParameters().get("pattern"); } File file = new File(url.getPath()); seqFileStream = new SequentialFileInputStream(file, pattern, removeAfterRead); return seqFileStream; }
/** * @see stream.urls.Connection#connect() */ @Override public InputStream connect() throws IOException { boolean removeAfterRead = "true".equalsIgnoreCase(url.getParameters() .get("remove")) || "true".equalsIgnoreCase(url.getParameters().get( "removeAfterRead")); String pattern = ".*"; if (url.getParameters().containsKey("pattern")) { pattern = url.getParameters().get("pattern"); } File file = new File(url.getPath()); seqFileStream = new SequentialFileInputStream(file, pattern, removeAfterRead); if (url.getParameters().containsKey("maxWaitingTime")) { seqFileStream.setMaxWaitingTime(new Long(url.getParameters().get( "maxWaitingTime"))); } return seqFileStream; }
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; } }
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; } }