- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.ibm.wala.properties.WalaProperties
类的一些代码示例,展示了WalaProperties
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WalaProperties
类的具体详情如下:
包路径:com.ibm.wala.properties.WalaProperties
类名称:WalaProperties
暂无
代码示例来源:origin: wala/WALA
public static <T, P, F> void viewIFDS(TabulationResult<T, P, F> r, Collection<? extends P> roots, NodeDecorator<T> labels)
throws WalaException {
Properties p = null;
try {
p = WalaProperties.loadProperties();
} catch (WalaException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
}
String scratch = p.getProperty(WalaProperties.OUTPUT_DIR);
viewIFDS(r, roots, labels, scratch);
}
代码示例来源:origin: wala/WALA
public static Properties loadProperties() throws WalaException {
try {
Properties result = loadPropertiesFromFile(WalaProperties.class.getClassLoader(), PROPERTY_FILENAME);
String outputDir = result.getProperty(OUTPUT_DIR, DefaultPropertiesValues.DEFAULT_OUTPUT_DIR);
result.setProperty(OUTPUT_DIR, convertToAbsolute(outputDir));
String walaReport = result.getProperty(WALA_REPORT, DefaultPropertiesValues.DEFAULT_WALA_REPORT_FILENAME);
result.setProperty(WALA_REPORT, convertToAbsolute(walaReport));
return result;
} catch (Exception e) {
// e.printStackTrace();
throw new WalaException("Unable to set up wala properties ", e);
}
}
代码示例来源:origin: wala/WALA
/**
* @return names of the Jar files holding J2EE libraries
* @throws IllegalStateException if the J2EE_DIR property is not set
*/
public static String[] getJ2EEJarFiles() {
Properties p = null;
try {
p = WalaProperties.loadProperties();
} catch (WalaException e) {
e.printStackTrace();
throw new IllegalStateException("problem loading wala.properties");
}
String dir = p.getProperty(WalaProperties.J2EE_DIR);
if (dir == null) {
throw new IllegalStateException("No J2EE directory specified");
}
return getJarsInDirectory(dir);
}
代码示例来源:origin: wala/WALA
protected void instrument(String testJarLocation) throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException {
if (! instrumentedJarBuilt) {
System.err.println("core data jar to instrument: " + testJarLocation);
Files.deleteIfExists(instrumentedJarLocation);
String rtJar = null;
for(String jar : WalaProperties.getJ2SEJarFiles()) {
if (jar.endsWith(File.separator + "rt.jar") || jar.endsWith(File.separator + "classes.jar")) {
rtJar = jar;
}
}
List<String> args = new ArrayList<>(Arrays.asList(testJarLocation, "-o", instrumentedJarLocation.toString()));
if (rtJar != null) {
args.addAll(Arrays.asList("--rt-jar", rtJar));
}
if (testPatchCalls) {
args.add("--patch-calls");
}
OfflineDynamicCallGraph.main(args.toArray(new String[0]));
Assert.assertTrue("expected to create " + instrumentedJarLocation, Files.exists(instrumentedJarLocation));
instrumentedJarBuilt = true;
}
}
代码示例来源:origin: wala/WALA
public static Properties loadProperties() {
try {
Properties result = WalaProperties.loadPropertiesFromFile(WalaExamplesProperties.class.getClassLoader(), PROPERTY_FILENAME);
return result;
} catch (Exception e) {
e.printStackTrace();
throw new IllegalStateException("Unable to set up wala examples properties ", e);
}
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
static String convertToAbsolute(String path) {
final File file = new File(path);
return (file.isAbsolute()) ? file.getAbsolutePath() : WalaProperties.getWalaHomeDir().concat(File.separator).concat(path);
}
代码示例来源:origin: wala/WALA
public static Properties loadPropertiesFromFile(ClassLoader loader, String fileName) throws IOException {
if (loader == null) {
throw new IllegalArgumentException("loader is null");
}
if (fileName == null) {
throw new IllegalArgumentException("null fileName");
}
try (final InputStream propertyStream = loader.getResourceAsStream(fileName)) {
if (propertyStream == null) {
// create default properties
Properties defprop = new Properties();
defprop.setProperty(OUTPUT_DIR, "./out");
defprop.setProperty(INPUT_DIR, "./in");
defprop.setProperty(ECLIPSE_PLUGINS_DIR, "./plugins");
defprop.setProperty(WALA_REPORT, "./wala_report.txt");
defprop.setProperty(J2EE_DIR, "./j2ee");
final String j2selib = guessJavaLib();
defprop.setProperty(J2SE_DIR, j2selib);
return defprop;
}
Properties result = new Properties();
result.load(propertyStream);
if (!result.containsKey(J2SE_DIR)) {
final String j2selib = guessJavaLib();
result.setProperty(J2SE_DIR, j2selib);
}
return result;
}
}
代码示例来源:origin: wala/WALA
scope.setLoaderImpl(walaLoader, entryPathname);
} else if ("stdlib".equals(entryType)) {
String[] stdlibs = WalaProperties.getJ2SEJarFiles();
for (String stdlib : stdlibs) {
scope.addToScope(walaLoader, new JarFile(stdlib, false));
代码示例来源:origin: wala/WALA
static String convertToAbsolute(String path) {
final File file = new File(path);
return (file.isAbsolute()) ? file.getAbsolutePath() : WalaProperties.getWalaHomeDir().concat(File.separator).concat(path);
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
public static Properties loadPropertiesFromFile(ClassLoader loader, String fileName) throws IOException {
if (loader == null) {
throw new IllegalArgumentException("loader is null");
}
if (fileName == null) {
throw new IllegalArgumentException("null fileName");
}
try (final InputStream propertyStream = loader.getResourceAsStream(fileName)) {
if (propertyStream == null) {
// create default properties
Properties defprop = new Properties();
defprop.setProperty(OUTPUT_DIR, "./out");
defprop.setProperty(INPUT_DIR, "./in");
defprop.setProperty(ECLIPSE_PLUGINS_DIR, "./plugins");
defprop.setProperty(WALA_REPORT, "./wala_report.txt");
defprop.setProperty(J2EE_DIR, "./j2ee");
final String j2selib = guessJavaLib();
defprop.setProperty(J2SE_DIR, j2selib);
return defprop;
}
Properties result = new Properties();
result.load(propertyStream);
if (!result.containsKey(J2SE_DIR)) {
final String j2selib = guessJavaLib();
result.setProperty(J2SE_DIR, j2selib);
}
return result;
}
}
代码示例来源:origin: wala/WALA
public static void main(String[] args) throws IllegalArgumentException, CancelException, IOException {
try {
Properties p = new Properties();
p.putAll(WalaProperties.loadProperties());
} catch (WalaException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
}
runTestCase(TestConstants.JLEX_MAIN, TestConstants.JLEX, "JLex");
// runTestCase(TestConstants.HELLO_MAIN, TestConstants.HELLO, "Hello");
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
/**
* @return names of the Jar files holding J2EE libraries
* @throws IllegalStateException if the J2EE_DIR property is not set
*/
public static String[] getJ2EEJarFiles() {
Properties p = null;
try {
p = WalaProperties.loadProperties();
} catch (WalaException e) {
e.printStackTrace();
throw new IllegalStateException("problem loading wala.properties");
}
String dir = p.getProperty(WalaProperties.J2EE_DIR);
if (dir == null) {
throw new IllegalStateException("No J2EE directory specified");
}
return getJarsInDirectory(dir);
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
scope.setLoaderImpl(walaLoader, entryPathname);
} else if ("stdlib".equals(entryType)) {
String[] stdlibs = WalaProperties.getJ2SEJarFiles();
for (String stdlib : stdlibs) {
scope.addToScope(walaLoader, new JarFile(stdlib, false));
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
public static Properties loadProperties() throws WalaException {
try {
Properties result = loadPropertiesFromFile(WalaProperties.class.getClassLoader(), PROPERTY_FILENAME);
String outputDir = result.getProperty(OUTPUT_DIR, DefaultPropertiesValues.DEFAULT_OUTPUT_DIR);
result.setProperty(OUTPUT_DIR, convertToAbsolute(outputDir));
String walaReport = result.getProperty(WALA_REPORT, DefaultPropertiesValues.DEFAULT_WALA_REPORT_FILENAME);
result.setProperty(WALA_REPORT, convertToAbsolute(walaReport));
return result;
} catch (Exception e) {
// e.printStackTrace();
throw new WalaException("Unable to set up wala properties ", e);
}
}
代码示例来源:origin: wala/WALA
/**
* Collect the set of JarFiles that constitute the system libraries of the running JRE.
*/
private JarFile[] getSystemJars() throws IOException {
String javaHomePath = "garbage";
Set<JarFile> jarFiles = HashSetFactory.make();
// first, see if wala.properties has been set up
try {
Properties p = WalaProperties.loadProperties();
javaHomePath = p.getProperty(WalaProperties.J2SE_DIR);
} catch (WalaException e) {
// no luck.
}
// if not, try assuming the running JRE looks normal
File x = new File(javaHomePath);
if (!(x.exists() && x.isDirectory())) {
javaHomePath = System.getProperty("java.home");
if (!javaHomePath.endsWith(File.separator)) {
javaHomePath = javaHomePath + File.separator;
}
javaHomePath = javaHomePath + "lib";
}
// find jars from chosen JRE lib path
collectJars(new File(javaHomePath), jarFiles);
return jarFiles.toArray(new JarFile[0]);
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
/**
* Determine the classpath noted in wala.properties for J2SE standard libraries
*
* If wala.properties cannot be loaded, returns jar files in boot classpath.
* @throws IllegalStateException if jar files cannot be discovered
* @see PlatformUtil#getBootClassPathJars()
*/
public static String[] getJ2SEJarFiles() {
Properties p = null;
try {
p = WalaProperties.loadProperties();
} catch (WalaException e) {
return PlatformUtil.getBootClassPathJars();
}
String dir = p.getProperty(WalaProperties.J2SE_DIR);
if (dir == null || !(new File(dir)).isDirectory()) {
System.err.println("WARNING: java_runtime_dir " + dir + " in wala.properties is invalid. Using boot class path instead.");
return PlatformUtil.getBootClassPathJars();
}
return getJarsInDirectory(dir);
}
代码示例来源:origin: wala/WALA
AnalysisScope scope = new JavaSourceAnalysisScope();
String[] stdlibs = WalaProperties.getJ2SEJarFiles();
for (String stdlib : stdlibs) {
scope.addToScope(ClassLoaderReference.Primordial, new JarFile(stdlib));
代码示例来源:origin: wala/WALA
/**
* @param appJar something like "c:/temp/testdata/java_cup.jar"
*/
public static Process run(String appJar, String exclusionFile) throws IllegalArgumentException, CancelException {
try {
Graph<CGNode> g = buildPrunedCallGraph(appJar, (new FileProvider()).getFile(exclusionFile));
Properties p = null;
try {
p = WalaExamplesProperties.loadProperties();
p.putAll(WalaProperties.loadProperties());
} catch (WalaException e) {
e.printStackTrace();
Assertions.UNREACHABLE();
}
String pdfFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDF_FILE;
String dotExe = p.getProperty(WalaExamplesProperties.DOT_EXE);
DotUtil.dotify(g, null, PDFTypeHierarchy.DOT_FILE, pdfFile, dotExe);
String gvExe = p.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
return PDFViewUtil.launchPDFView(pdfFile, gvExe);
} catch (WalaException e) {
e.printStackTrace();
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
代码示例来源:origin: wala/WALA
/**
* Determine the classpath noted in wala.properties for J2SE standard libraries
*
* If wala.properties cannot be loaded, returns jar files in boot classpath.
* @throws IllegalStateException if jar files cannot be discovered
* @see PlatformUtil#getBootClassPathJars()
*/
public static String[] getJ2SEJarFiles() {
Properties p = null;
try {
p = WalaProperties.loadProperties();
} catch (WalaException e) {
return PlatformUtil.getBootClassPathJars();
}
String dir = p.getProperty(WalaProperties.J2SE_DIR);
if (dir == null || !(new File(dir)).isDirectory()) {
System.err.println("WARNING: java_runtime_dir " + dir + " in wala.properties is invalid. Using boot class path instead.");
return PlatformUtil.getBootClassPathJars();
}
return getJarsInDirectory(dir);
}
代码示例来源:origin: wala/WALA
wp = WalaProperties.loadProperties();
wp.putAll(WalaExamplesProperties.loadProperties());
} catch (WalaException e) {
本文整理了Java中com.ibm.wala.properties.WalaProperties.loadPropertiesFromFile()方法的一些代码示例,展示了WalaProperties
本文整理了Java中com.ibm.wala.properties.WalaProperties.loadProperties()方法的一些代码示例,展示了WalaProperties.loadPro
本文整理了Java中com.ibm.wala.properties.WalaProperties.getJarsInDirectory()方法的一些代码示例,展示了WalaProperties.get
本文整理了Java中com.ibm.wala.properties.WalaProperties.convertToAbsolute()方法的一些代码示例,展示了WalaProperties.conv
本文整理了Java中com.ibm.wala.properties.WalaProperties.getJ2SEJarFiles()方法的一些代码示例,展示了WalaProperties.getJ2S
我是一名优秀的程序员,十分优秀!