private static URI buildUri(String rrdPath, URI rrdUri, RrdBackendFactory factory) { if (rrdUri != null) { return rrdUri; } else if (factory == null) { return RrdBackendFactory.buildGenericUri(rrdPath); } else { return factory.getCanonicalUri(RrdBackendFactory.buildGenericUri(rrdPath)); } }
/** * <p>Creates new RRD definition object with the given path. * When this object is passed to * <code>RrdDb</code> constructor, new RRD will be created using the * specified path.</p> * <p>The will be transformed internally to an URI using the default backend factory.</p> * * @param rrdpath Path to new RRD. */ public RrdDef(String rrdpath) { if (rrdpath == null || rrdpath.length() == 0) { throw new IllegalArgumentException("No path specified"); } this.uri = RrdBackendFactory.buildGenericUri(rrdpath); }