com.sap.psr.vulas.shared.util.FileUtil.getJARFilePath()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中com.sap.psr.vulas.shared.util.FileUtil.getJARFilePath()方法的一些代码示例,展示了FileUtil.getJARFilePath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.getJARFilePath()方法的具体详情如下:
包路径:com.sap.psr.vulas.shared.util.FileUtil
类名称:FileUtil
方法名:getJARFilePath

FileUtil.getJARFilePath介绍

[英]Provided that the given URL points to a JAR file (or classes contained therein), the method transforms the string representation of the given URL into a string presentation of the local file system path of the JAR file. If the URL does not point to a JAR, the method returns null. Examples of URLs are as follows: url:file:/a/b/c.jar!123.class file:/a/b/c.jar
[中]如果给定URL指向JAR文件(或其中包含的类),则该方法将给定URL的字符串表示形式转换为JAR文件的本地文件系统路径的字符串表示形式。如果URL不指向JAR,则该方法返回null。url的示例如下:url:file:/a/b/c.jar!123.class文件:/a/b/c.jar

代码示例

代码示例来源:origin: SAP/vulnerability-assessment-tool

public static String getJarFilePath(Class<?> _clazz) {
  final ClassLoader cl = _clazz.getClassLoader();
  final URL res_url = cl.getResource(_clazz.getName().replace('.', '/') + ".class");
  return FileUtil.getJARFilePath(res_url.toString());
}

代码示例来源:origin: SAP/vulnerability-assessment-tool

final String jar_path = FileUtil.getJARFilePath(_url.toString());
if(jar_path==null) return false;

代码示例来源:origin: SAP/vulnerability-assessment-tool

getLog().info("Class loader search path contains [" + urls.length + "] items: Search for configurations in JAR files");
for(int i=0; i<urls.length; i++) {
  final String jar_path = FileUtil.getJARFilePath(urls[i].toString());
  if(jar_path!=null) {
    if(!jar_paths_analyzed.contains(jar_path)) {

代码示例来源:origin: SAP/vulnerability-assessment-tool

jar_path = (jar_url==null ? null : FileUtil.getJARFilePath(jar_url.toString()));
if(jar_path!=null && this.jarFiles.containsKey(jar_path)) {
  ja = this.jarFiles.get(jar_path);

代码示例来源:origin: SAP/vulnerability-assessment-tool

final String jar_path = (_url == null ? null : FileUtil.getJARFilePath(_url.toString())); // The complete FS path pointing to the JAR
final String jar_name = (jar_path == null ? null : FileUtil.getFileName(jar_path));

代码示例来源:origin: SAP/vulnerability-assessment-tool

final String callee_jar_path = (_callee_url == null ? null : FileUtil.getJARFilePath(_callee_url.toString()));
JarAnalyzer callee_ja = null;
if(callee_jar_path!=null ) callee_ja = tpi.getJarAnalyzerByPath(callee_jar_path);
final String caller_jar_path = (caller_url == null ? null : FileUtil.getJARFilePath(caller_url.toString()));
JarAnalyzer caller_ja = null;
if(caller_jar_path!=null ) caller_ja = tpi.getJarAnalyzerByPath(caller_jar_path);

相关文章