當前位置: 首頁>>代碼示例>>Java>>正文


Java FileVisitResult.TERMINATE屬性代碼示例

本文整理匯總了Java中java.nio.file.FileVisitResult.TERMINATE屬性的典型用法代碼示例。如果您正苦於以下問題:Java FileVisitResult.TERMINATE屬性的具體用法?Java FileVisitResult.TERMINATE怎麽用?Java FileVisitResult.TERMINATE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.nio.file.FileVisitResult的用法示例。


在下文中一共展示了FileVisitResult.TERMINATE屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: postVisitDirectory

@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
	if(onDiff == OnDiff.DELETE) {
		Path relative = expected.relativize(dir);
		if (other.resolve(relative).toFile().exists()) {
			log.debug("Other has dir: {}", relative);
		} else {
			diffPresent = true;
			try {
				log.info("GitRepo contains dir that is no longer present locally: {}, deleting", relative);
				Files.delete(dir);
			} 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,代碼行數:20,代碼來源:SourceCodeUpdater.java

示例3: 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

示例4: visitFile

@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
    if (file.toString().endsWith(".class")) {
        className = getClassName(file.toAbsolutePath().toString());
        return FileVisitResult.TERMINATE;
    }
    return FileVisitResult.CONTINUE;
}
 
開發者ID:TNG,項目名稱:ArchUnit,代碼行數:8,代碼來源:OutsideOfClassPathRule.java

示例5: visitFileFailed

@Override
public FileVisitResult visitFileFailed(Path file, IOException ioe)
        throws IOException {
    this.exception = ioe;
    return FileVisitResult.TERMINATE;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:6,代碼來源:Tools.java


注:本文中的java.nio.file.FileVisitResult.TERMINATE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。