當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。