Example usage for java.nio.file SimpleFileVisitor subclass-usage

List of usage examples for java.nio.file SimpleFileVisitor subclass-usage

Introduction

In this page you can find the example usage for java.nio.file SimpleFileVisitor subclass-usage.

Usage

From source file DeleteDirectory.java

class DeleteDirectory extends SimpleFileVisitor<Path> {
    @Override
    public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException {
        System.out.println("Deleting " + file.getFileName());
        Files.delete(file);
        return FileVisitResult.CONTINUE;

From source file ListFiles.java

class ListFiles extends SimpleFileVisitor<Path> {
    private final int indentionAmount = 3;
    private int indentionLevel;

    public ListFiles() {
        indentionLevel = 0;

From source file Test.java

class FindJavaVisitor extends SimpleFileVisitor<Path> {
    @Override
    public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {

        if (file.toString().endsWith(".java")) {
            System.out.println(file.getFileName());

From source file Test.java

class CopyDirectory extends SimpleFileVisitor<Path> {

    private Path source;
    private Path target;

    public CopyDirectory(Path source, Path target) {

From source file de.bbe_consulting.mavento.helper.visitor.FileSizeVisitor.java

/**
 * FileVisitor to count directory size in bytes in a mutable long, passed via constructor.
 * 
 * @author Erik Dannenberg
 */
public class FileSizeVisitor extends SimpleFileVisitor<Path> {

From source file com.ejisto.util.visitor.ConditionMatchingCopyFileVisitor.java

/**
 * Created by IntelliJ IDEA.
 * User: celestino
 * Date: 2/14/14
 * Time: 8:00 AM
 */

From source file com.nridge.connector.fs.con_fs.core.FileCrawler.java

/**
 * The FileCrawler uses the Visitor design pattern to traverse a
 * file system hierarchy.  Please note that not all of the overridden
 * methods are used - they are kept here in case there is need in the
 * future for overriding them.
 *

From source file company.gonapps.loghut.utils.FileUtils.java

class FileScanner extends SimpleFileVisitor<Path> {
    List<Path> paths;

    public List<Path> scan(Path path) throws IOException {
        paths = new LinkedList<>();
        Files.walkFileTree(path, this);

From source file org.apache.openaz.xacml.pdp.test.TestBase.java

/**
 * This is a base class for setting up a test environment. Using properties files, it contains the necessary
 * information for 1. defining and providing attributes 2. defining and instantiating the PDP engine 3.
 * creating PEP requests and calling the PDP engine
 */
public class TestBase extends SimpleFileVisitor<Path> {

From source file gov.noaa.pfel.coastwatch.util.FileVisitorDNLS.java

/**
 * This class gathers basic information about a group of files.
 * This follows Linux symbolic links, but not Windows .lnk's (see testSymbolicLinks() below).
 *
 * @author Bob Simons (bob.simons@noaa.gov) 2014-11-25
 */