org.openide.filesystems.FileUtil.isArchiveArtifact()方法的使用及代码示例

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

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

FileUtil.isArchiveArtifact介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

/**
 * Translated classpath to String (ENTRY PATH_SEPARATOR FLAGS) (PATH_SEPARATOR ENTRY PATH_SEPARATOR FLAGS)*
 * @param cp the classpath to translate
 * @return the translated classpath
 */
@NonNull
private static String pathToFlaggedString(
    @NullAllowed ClassPath cp,
    final boolean checkArchiveFile) {
  final StringBuilder b = new StringBuilder();
  if (cp == null) {
    cp = ClassPath.EMPTY;
  }
  for (final ClassPath.Entry cpe : cp.entries()) {
    //Entry.getRoot() returns root which is valid for deleted jar
    //in ClassPath.PROP_ROOTS event
    final boolean exists = Optional.ofNullable(cpe.getRoot())
        .map((fo) -> (checkArchiveFile && FileUtil.isArchiveArtifact(fo)) ? FileUtil.getArchiveFile(fo) : fo)
        .map((fo) -> checkArchiveFile ? fo.isValid() : true)
        .orElse(Boolean.FALSE);
    append(b,cpe.getURL())
        .append(File.pathSeparatorChar)
        .append(exists ? PATH_FLAG_EXISTS : 0);
  }
  return b.toString();
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base

.map((e) -> e.getRoot())
.filter((fo) -> fo != null && fo.isValid())
.map((fo) -> FileUtil.isArchiveArtifact(fo) ? FileUtil.getArchiveFile(fo) : fo)
.filter((fo) -> fo != null && fo.isValid())
.map(FileUtil::toFile)

代码示例来源:origin: org.gephi/desktop-import

if (FileUtil.isArchiveArtifact(fileObjects[i])) {
  try {

相关文章