KylinConfig extends KylinConfigBase { public static KylinConfig createInstanceFromUri(String uri) { UriType uriType = decideUriType(uri); if (uriType == UriType.LOCAL_FOLDER) { KylinConfig config = new KylinConfig(); config.setMetadataUrl(uri); return config; } else if (uriType == UriType.PROPERTIES_FILE) { KylinConfig config; try { config = new KylinConfig(); InputStream is = new FileInputStream(uri); Properties prop = streamToProps(is); config.reloadKylinConfig(prop); } catch (IOException e) { throw new RuntimeException(e); } return config; } else { try { KylinConfig config = new KylinConfig(); RestClient client = new RestClient(uri); String propertyText = client.getKylinProperties(); InputStream is = IOUtils.toInputStream(propertyText, Charset.defaultCharset()); Properties prop = streamToProps(is); config.reloadKylinConfig(prop); return config; } catch (IOException e) { throw new RuntimeException(e); } } } private  KylinConfig(); protected  KylinConfig(Properties props, boolean force); static File getKylinHomeAtBestEffort(); static KylinConfig getInstanceFromEnv(); static void destroyInstance(); static KylinConfig createInstanceFromUri(String uri); static Properties streamToProps(InputStream is); static void setKylinConfigInEnvIfMissing(Properties prop); static void setKylinConfigInEnvIfMissing(String propsInStr); static SetAndUnsetThreadLocalConfig setAndUnsetThreadLocalConfig(KylinConfig config); static KylinConfig createKylinConfig(String propsInStr); static KylinConfig createKylinConfig(KylinConfig another); static KylinConfig createKylinConfig(Properties prop); static File getKylinConfDir(); static void setSandboxEnvIfPossible(); T getManager(Class<T> clz); void clearManagers(); Properties exportToProperties(); String exportAllToString(); String exportToString(Collection<String> propertyKeys); void exportToFile(File file); synchronized void reloadFromSiteProperties(); KylinConfig base(); static void setKylinConfigForLocalTest(String localMetaDir); @Override int hashCode(); @Override boolean equals(Object another); static final String KYLIN_CONF_PROPERTIES_FILE; static final String KYLIN_DEFAULT_CONF_PROPERTIES_FILE; static final String KYLIN_CONF; }
@Test(expected = IllegalStateException.class) public void testCreateInstanceFromUriThrowsIllegalStateExceptionOne() { KylinConfig.createInstanceFromUri("cb%MnlG]3:nav"); }