当前位置: 首页>>代码示例>>Java>>正文


Java FileVisitResult.SKIP_SUBTREE属性代码示例

本文整理汇总了Java中java.nio.file.FileVisitResult.SKIP_SUBTREE属性的典型用法代码示例。如果您正苦于以下问题:Java FileVisitResult.SKIP_SUBTREE属性的具体用法?Java FileVisitResult.SKIP_SUBTREE怎么用?Java FileVisitResult.SKIP_SUBTREE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.nio.file.FileVisitResult的用法示例。


在下文中一共展示了FileVisitResult.SKIP_SUBTREE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
	
	// --- Check if the current folder is in the skipList ------
	if(this.skipList != null){
 	for(Path pathToSkip : skipList){
 		if(pathToSkip.equals(dir)){
 			return FileVisitResult.SKIP_SUBTREE;
 		}
 	}
	}
	
	// --- If not, create a corresponding folder in the target path ---------------
    Path targetPath = toPath.resolve(fromPath.relativize(dir));
    if(!Files.exists(targetPath)){
        Files.createDirectory(targetPath);
    }
    
    return FileVisitResult.CONTINUE;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:20,代码来源:RecursiveFolderCopier.java

示例2: visitFile

@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
	
	// --- Check if the current file is in the skipList ------
	if(this.skipList != null){
 	for(Path pathToSkip : skipList){
 		if(pathToSkip.equals(file)){
 			return FileVisitResult.SKIP_SUBTREE;
 		}
 	}
	}
	
	// --- If not, copy it ---------------
	Files.copy(file, toPath.resolve(fromPath.relativize(file)), copyOption);
    return FileVisitResult.CONTINUE;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:16,代码来源:RecursiveFolderCopier.java

示例3: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attr) {
	if (dir.getFileName().toString().equals(".git")) {
		return FileVisitResult.SKIP_SUBTREE;
	}
	if(onDiff == OnDiff.COPY) {
		Path relative = expected.relativize(dir);
		if (other.resolve(relative).toFile().exists()) {
			log.debug("Other has dir: {}", relative);
		} else {
			diffPresent = true;
			try {
				log.info("GitRepo does not contain dir: {}, adding", relative);
				Files.copy(dir, other.resolve(relative));
			} catch (IOException e) {
				log.error("IO happend, new build will be created", e.getMessage());
				error = true;
				return FileVisitResult.TERMINATE;
			}
		}
	}
	return FileVisitResult.CONTINUE;
}
 
开发者ID:xtf-cz,项目名称:xtf,代码行数:23,代码来源:SourceCodeUpdater.java

示例4: visitFile

@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
	final String fileName = file.getFileName().toString();
	if (fileName.equals(N4JSGlobals.PACKAGE_JSON)) {
		cleanJsonFile(file.toFile());
		return FileVisitResult.SKIP_SUBTREE;
	}
	return FileVisitResult.CONTINUE;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:9,代码来源:UpdateShippedCode.java

示例5: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs)
      throws IOException {
   Boolean hide = false;
   // TODO remove attrs, if path is matched in this dir, then it is too in every subdir.
   // And we will check anyway
   DirAttributes newAttr = attributes.peek().clone();

   // check per config ignorePaths!
   for (BuildConfig cfg : allConfigs) {
      if (cfg.matchesIgnoredPath(path.toAbsolutePath().toString())) {
         newAttr.setIgnore(cfg);
      }

      // Hide is always on all configs. And additional files are never hiddden
      if (cfg.matchesHidePath(path.toAbsolutePath().toString())) {
         hide = true;
         break;
      }
   }

   if (!hide) {
      String name = startDir.relativize(path.toAbsolutePath()).toString();
      if (!"".equals(name)) {
         wg.addFilter(name);
      }

      attributes.push(newAttr);
      return super.preVisitDirectory(path, attrs);
   } else {
      return FileVisitResult.SKIP_SUBTREE;
   }
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:33,代码来源:FileTreeCreatorVC10.java

示例6: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs)
      throws IOException {
   Boolean hide = false;
   DirAttributes newAttr = attributes.peek().clone();

   String rPath;
   if (path.toAbsolutePath().toString().equals(this.startDir.toAbsolutePath().toString())){
      rPath = startDir.toString();
   } else {
      rPath = path.getFileName().toString();
   }

   // check per config ignorePaths!
   for (BuildConfig cfg : allConfigs) {
      if (cfg.matchesIgnoredPath(path.toAbsolutePath().toString())) {
         newAttr.setIgnore(cfg);
      }

      // Hide is always on all configs. And additional files are never hiddden
      if (cfg.matchesHidePath(path.toAbsolutePath().toString())) {
         hide = true;
         break;
      }
   }

   if (!hide) {
      wg.startTag("Filter", new String[] {
            "Name", rPath});

      attributes.push(newAttr);
      return super.preVisitDirectory(path, attrs);
   } else {
      return FileVisitResult.SKIP_SUBTREE;
   }
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:36,代码来源:FileTreeCreatorVC7.java

示例7: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs)
      throws IOException {
   Boolean hide = false;
   // TODO remove attrs, if path is matched in this dir, then it is too in every subdir.
   // And we will check anyway
   DirAttributes newAttr = attributes.peek().clone();

   // check per config ignorePaths!
   for (BuildConfig cfg : allConfigs) {
      if (cfg.matchesIgnoredPath(path.toAbsolutePath().toString())) {
         newAttr.setIgnore(cfg);
      }

      // Hide is always on all configs. And additional files are never hiddden
      if (cfg.matchesHidePath(path.toAbsolutePath().toString())) {
         hide = true;
         break;
      }
   }

   if (!hide) {
      String name = startDir.relativize(path.toAbsolutePath()).toString();
      if (!"".equals(name)) {
         wg10.addFilter(name);
      }

      attributes.push(newAttr);
      return super.preVisitDirectory(path, attrs);
   } else {
      return FileVisitResult.SKIP_SUBTREE;
   }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:FileTreeCreatorVC10.java

示例8: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attributes) throws IOException {
	final String path = minimizePath(dir);
	if (path.equals("")) {
		return FileVisitResult.CONTINUE;
	}
	if (path.matches("/\\d+_[A-Z]{2}[A-Z0-9][A-Z0-9]")) {
		return FileVisitResult.CONTINUE;
	}
	if (path.matches("/.+/\\d")) {
		return FileVisitResult.CONTINUE;
	}
	return FileVisitResult.SKIP_SUBTREE;
}
 
开发者ID:boardend,项目名称:tabularius,代码行数:14,代码来源:NumbersFileWalker.java

示例9: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
    log.trace("preVisit {}",dir);
    //if(Thread.currentThread().isInterrupted()){
    if(this.abortAsked){
        return FileVisitResult.TERMINATE;
    }
    if(this.crawler.isDirectoryInExclusion(dir)){
        log.trace("exclude directory {}",dir);
        return FileVisitResult.SKIP_SUBTREE;//like SKIP_SUBTREE and no call to postVisitDirectory
    }
    return FileVisitResult.CONTINUE;
}
 
开发者ID:klask-io,项目名称:klask-io,代码行数:13,代码来源:FileSystemVisitorCrawler.java

示例10: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
	Path relativePath = basePath.relativize(dir);
	if (filesToIgnore.contains(relativePath.toString())) {
		return FileVisitResult.SKIP_SUBTREE;
	} else {
		return FileVisitResult.CONTINUE;
	}
}
 
开发者ID:Azzurite,项目名称:MinecraftServerSync,代码行数:9,代码来源:FilteringSaveFileListVisitor.java

示例11: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
    // Skip /proc because it can throw some permission errors we cannot check for.
    return "/proc".equals(dir.toString()) ? FileVisitResult.SKIP_SUBTREE : FileVisitResult.CONTINUE;
}
 
开发者ID:DevOpsStudio,项目名称:Re-Collector,代码行数:5,代码来源:GlobPathSet.java

示例12: visitFileFailed

@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
    LOG.warn("Unable to change into directory {} - Check permissions", file);
    return FileVisitResult.SKIP_SUBTREE;
}
 
开发者ID:DevOpsStudio,项目名称:Re-Collector,代码行数:5,代码来源:GlobPathSet.java

示例13: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
    return !isDirExcluded(dir) ? FileVisitResult.CONTINUE : FileVisitResult.SKIP_SUBTREE;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:4,代码来源:NpmPackageFileFinder.java

示例14: postVisitDirectory

@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
    // Skip sub directories without permissions
    return exc == null ? FileVisitResult.CONTINUE : FileVisitResult.SKIP_SUBTREE;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:5,代码来源:NpmPackageFileFinder.java

示例15: preVisitDirectory

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
    return Files.isReadable(dir) ? FileVisitResult.CONTINUE : FileVisitResult.SKIP_SUBTREE;
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Programming-Blueprints,代码行数:4,代码来源:SourceDirScanner.java


注:本文中的java.nio.file.FileVisitResult.SKIP_SUBTREE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。