@@ -0,0 +1,1471 @@
+import java.io.File;%0Aimport java.io.IOException;%0Aimport java.security.InvalidParameterException;%0Aimport java.util.*;%0A%0Apublic class Directory %7B%0A    private File path;%0A    /** * @var array */%0A    private ArrayList%3CDirectory%3E directories;%0A    /** * @var array */%0A    private ArrayList%3CFile%3E files;%0A%0A    public Directory(File path)%7B%0A        if(path.exists() && path.isDirectory()) %7B%0A            this.path = path;%0A            this.directories = new ArrayList%3CDirectory%3E();%0A            this.files = new ArrayList%3CFile%3E();%0A        %7D%0A        else%0A            throw new InvalidParameterException();%0A    %7D%0A    public void scan() throws IOException %7B%0A        String%5B%5D paths;%0A        paths = this.path.list();%0A%0A        for(String path:paths)%7B%0A            File tmp = new File(this.path, path);%0A            if(tmp.isDirectory())%7B%0A                Directory dir = new Directory(tmp);%0A                this.directories.add(dir);%0A            %7D%0A            else%0A                this.files.add(tmp);%0A        %7D%0A    %7D%0A    public File getPath() %7B%0A        return path;%0A    %7D%0A    public void setPath(File path) %7B%0A        this.path = path;%0A    %7D%0A    public ArrayList%3CDirectory%3E getDirectories() %7B%0A        return directories;%0A    %7D%0A    public void setDirectories(ArrayList%3CDirectory%3E directories) %7B%0A        this.directories = directories;%0A    %7D%0A    public ArrayList%3CFile%3E getFiles() %7B%0A        return files;%0A    %7D%0A    public void setFiles(ArrayList%3CFile%3E files) %7B%0A        this.files = files;%0A    %7D%0A%7D%0A

Create Directory.java