本文整理了Java中org.jgroups.util.Util.getResourceAsStream()
方法的一些代码示例,展示了Util.getResourceAsStream()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getResourceAsStream()
方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:getResourceAsStream
暂无
代码示例来源:origin: wildfly/wildfly
protected static InputStream findFile(String filename) {
try {return new FileInputStream(filename);} catch(FileNotFoundException e) {}
File file=new File(filename);
String name=file.getName();
try {return new FileInputStream(name);} catch(FileNotFoundException e) {}
try {
String home_dir=System.getProperty("user.home");
filename=home_dir + File.separator + name;
try {return new FileInputStream(filename);} catch(FileNotFoundException e) {}
}
catch(Throwable t) {
}
return Util.getResourceAsStream(name, MPerf.class);
}
代码示例来源:origin: wildfly/wildfly
public static InputStream getForkStream(String config) throws IOException {
InputStream configStream = null;
try {
configStream=new FileInputStream(config);
}
catch(FileNotFoundException | AccessControlException fnfe) { // catching ACE fixes http://jira.jboss.com/jira/browse/JGRP-94
}
// Check to see if the properties string is a URL.
if(configStream == null) {
try {
configStream=new URL(config).openStream();
}
catch (MalformedURLException ignored) {
}
}
// Check to see if the properties string is the name of a resource, e.g. udp.xml.
if(configStream == null)
configStream=Util.getResourceAsStream(config, ConfiguratorFactory.class);
return configStream;
}
代码示例来源:origin: wildfly/wildfly
/**
* try to read the magic number configuration file as a Resource form the classpath using getResourceAsStream
* if this fails this method tries to read the configuration file from mMagicNumberFile using a FileInputStream (not in classpath but somewhere else in the disk)
*
* @return an array of ClassMap objects that where parsed from the file (if found) or an empty array if file not found or had en exception
*/
protected static List<Triple<Short,String,Boolean>> readMappings(String name) throws Exception {
InputStream stream;
stream=Util.getResourceAsStream(name, ClassConfigurator.class);
// try to load the map from file even if it is not a Resource in the class path
if(stream == null)
stream=new FileInputStream(name);
return parse(stream);
}
代码示例来源:origin: wildfly/wildfly
configStream=Util.getResourceAsStream(properties, ConfiguratorFactory.class);
return configStream;
代码示例来源:origin: wildfly/wildfly
input=Util.getResourceAsStream(keystore_name, getClass());
代码示例来源:origin: org.jboss.eap/wildfly-client-all
protected static InputStream findFile(String filename) {
try {return new FileInputStream(filename);} catch(FileNotFoundException e) {}
File file=new File(filename);
String name=file.getName();
try {return new FileInputStream(name);} catch(FileNotFoundException e) {}
try {
String home_dir=System.getProperty("user.home");
filename=home_dir + File.separator + name;
try {return new FileInputStream(filename);} catch(FileNotFoundException e) {}
}
catch(Throwable t) {
}
return Util.getResourceAsStream(name, MPerf.class);
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
public static InputStream getForkStream(String config) throws IOException {
InputStream configStream = null;
try {
configStream=new FileInputStream(config);
}
catch(FileNotFoundException | AccessControlException fnfe) { // catching ACE fixes http://jira.jboss.com/jira/browse/JGRP-94
}
// Check to see if the properties string is a URL.
if(configStream == null) {
try {
configStream=new URL(config).openStream();
}
catch (MalformedURLException ignored) {
}
}
// Check to see if the properties string is the name of a resource, e.g. udp.xml.
if(configStream == null)
configStream=Util.getResourceAsStream(config, ConfiguratorFactory.class);
return configStream;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* try to read the magic number configuration file as a Resource form the classpath using getResourceAsStream
* if this fails this method tries to read the configuration file from mMagicNumberFile using a FileInputStream (not in classpath but somewhere else in the disk)
*
* @return an array of ClassMap objects that where parsed from the file (if found) or an empty array if file not found or had en exception
*/
protected static List<Triple<Short,String,Boolean>> readMappings(String name) throws Exception {
InputStream stream;
stream=Util.getResourceAsStream(name, ClassConfigurator.class);
// try to load the map from file even if it is not a Resource in the class path
if(stream == null)
stream=new FileInputStream(name);
return parse(stream);
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
configStream=Util.getResourceAsStream(properties, ConfiguratorFactory.class);
return configStream;
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
InputStream stream=Util.getResourceAsStream(mMagicNumberFile, this.getClass());
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
configStream=Util.getResourceAsStream(properties, ConfiguratorFactory.class);
代码示例来源:origin: org.jboss.eap/wildfly-client-all
input=Util.getResourceAsStream(keystore_name, getClass());
代码示例来源:origin: org.jboss.cluster/jboss-ha-server-core
input=Util.getResourceAsStream((String)properties, ConfiguratorFactory.class);
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
input=Util.getResourceAsStream((String)properties, ConfiguratorFactory.class);
内容来源于网络,如有侵权,请联系作者删除!