package com.leafriend.flix;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Flix {

    private Options options;

    private int directoryCount;

    private int fileCount;

    private List<File> files;

    public static void main(String[] args) {

        Options options = new Options();

        new Flix(options).run();

    }

    public Flix(Options options) {
        this.options = options;
        this.directoryCount = 0;
        this.fileCount = 0;
        this.files = new ArrayList<>();
    }

    public void run() {

    }

    public void traverse(File dir) throws IOException {
        for (File file : dir.listFiles()) {
            String path = file.getCanonicalPath();
            if (file.isFile()) {
                fileCount++;
                files.add(file);
                if (options.isVerbose()) {
                    String name = file.getName();
                    System.out.print(name);
                    // try { Thread.sleep(100); } catch (InterruptedException e)
                    // {
                    // // TODO Auto-generated catch block e.printStackTrace(); }
                    for (int i = 0; i < name.length(); i++)
                        System.out.print("\b");
                    for (int i = 0; i < name.length(); i++)
                        System.out.print(" ");
                    for (int i = 0; i < name.length(); i++)
                        System.out.print("\b");
                }
            } else if (file.isDirectory()) {
                directoryCount++;
                if (options.isVerbose()) {
                    System.out.print("\n");
                    System.out.print(path + File.separator);
                }
                traverse(file);
            } else {
                error("Path '" + path + "' is not a file or directory");
            }
        }
    }

    private void error(String string) {
        // TODO Auto-generated method stub
        throw new UnsupportedOperationException("Not yet implemented");
    }

}

@@ -590,24 +590,586 @@
 oid run() %7B%0A
+        try %7B%0A%0A            if (options.isVerbose()) %7B%0A                System.out.print(options.getScanDirectory().getCanonicalPath());%0A            %7D%0A            traverse(options.getScanDirectory());%0A%0A            System.out.print(options.getOutputFile().getCanonicalPath()%0A                    + %22 is generated for %22 + fileCount + %22 file%22%0A                    + (fileCount %3E 1 ? %22s%22 : %22%22) + %22 in %22 + directoryCount%0A                    + %22 director%22 + (directoryCount %3E 1 ? %22ies%22 : %22y%22));%0A%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D
 %0A    %7D%0A%0A    

Add run body