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

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

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

FileUtil.getPath介绍

[英]Returns a Path object for the given String in case the path exists in the file system, null otherwise.
[中]如果路径存在于文件系统中,则返回给定字符串的路径对象,否则返回null。

代码示例

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

/**
 * Returns a {@link Path} object for the given {@link String} in case the path exists in the file system, null otherwise.
 * @param _path
 * @return
 */
public static Path getPath(String _path) {
  return FileUtil.getPath(_path, false);
}

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

this.setLibPath(FileUtil.getPath(VulasConfiguration.getGlobal().getConfiguration().getString(CoreConfiguration.INSTR_LIB_DIR, null)));
this.setInclPath(FileUtil.getPath(VulasConfiguration.getGlobal().getConfiguration().getString(CoreConfiguration.INSTR_INCLUDE_DIR, null)));
this.setTargetPath(FileUtil.getPath(VulasConfiguration.getGlobal().getConfiguration().getString(CoreConfiguration.INSTR_TARGET_DIR, null), true));

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

/**
 * Expects a {@link String} array with multiple paths and returns a set for all those paths that represent
 * accessible files or directories in the file system.
 * @param _p
 */
public static Set<Path> getPaths(String[] _paths) {
  final Set<Path> r = new HashSet<Path>();
  if(_paths!=null) {
    for(int i=0; i<_paths.length; i++) {
      final Path p = FileUtil.getPath(_paths[i]);
      if(p!=null)
        r.add(p);
    }
  }
  return r;
}

相关文章