⑴ java怎么遍历一个盘下的所有文件
用递归算法,递归可以理解成自己调用自己,但要有终止条件
首先是判断这个是文件还是文件夹。文件的话就处理文件;文件夹的话,列出里面的文件,再对每一个文件做同样的判断处理
下面是删除一个文件夹(改成列出所有文件的话,你把删除操作改成放入集合操作),所有删除都是只能删除一个文件或者是空文件夹,所以遇到文件夹就得把里面的文件全部删除
privatestaticvoiddeleteFile(Filefile){
if(!file.exists())
return;
System.out.print("删除===");
if(file.isFile()){
System.out.println("文件:"+file);
file.delete();
}else{
System.out.println("文件夹:"+file);
for(Filef:file.listFiles()){
deleteFile(f);
}
file.delete();
}
}
同理(Node是自己定义的类,主要包含了name(String),children (List<Node>)这两个属性来表达层级):
遍历了这个文件夹之后返回这个文件夹的Node作为上一个文件加的children之一,这就把文件夹的层级结构列出来了,当然你也可以用Map来存储这些数据
/**
*列出文件目录结构
*
*@paramfolder
*@paramfnf
*@return
*/
privatestaticNodelsFiles(Filefolder){
Noden=newNode();
n.setName(folder.getName());
n.setPath(folder.getAbsolutePath());
if(folder.isFile()){
n.setLeaf(true);
n.setSize(folder.length());
}else{
n.setLeaf(false);
File[]folders=folder.listFiles();//列出文件夹底下的文件
for(Filefile:folders){//遍历每个文件做相同操作
Nodecn=lsFiles(file);
n.getChildren().add(cn);
n.setSize(n.getSize()+cn.getSize());
}
}
returnn;
}
下面是不分层次结构来列出所有文件(纯手写,可能有语法错误)
/**
*列出文件路径
*
*@paramfolder
*@paramfnf
*@return
*/
privatestaticList<String>lsFiles(Filefolder){
List<String>l=newArrayList<String>();
l.add(folder.getAbsolutePath());
if(folder.isFile()){
//处理file
}else{
File[]folders=folder.listFiles();
for(Filefile:folders){
l.addAll(lsFiles(file));
}
}
returnl;
}
效果
⑵ 使用java递归方法遍历指定目录下所有子目录和子文件
import java.io.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* 读取目录及子目录下指定文件名的路径 并放到一个数组里面返回遍历
* @author zdz8207
*
*/
public class FileViewer {
public static void main(String[] args) {
//List arrayList = FileViewer.getListFiles("d:/com","html",true);
//读取d:/com下的以java 结尾的文件 如有子目录,包含之(后缀名为null则为所有文件)
//List arrayList = FileViewer.getListFiles("d:/com","java",true);
//经试验,后缀不能不填写,否则编译不通过,提示“FileViewer.java:17: 非法的表达式开始”。
//另外后缀为""时的情况需要 增加到IF 里去,否则 后缀为""时,不会显示所有文件
List arrayList = FileViewer.getListFiles("d:/com","",true);
if(arrayList.isEmpty())
{
System.out.println("没有符号要求的文件");
}
else
{
String message = "";
message += "符号要求的文件数:" + arrayList.size() + "\r\n";
System.out.println(message);
for (Iterator i = arrayList.iterator(); i.hasNext();)
{
String temp = (String) i.next();
System.out.println(temp);
message += temp + "\r\n";
}
//将显示的文件路径写到指定的文件里,若文件不存在,则提示IO异常
//java.io.FileNotFoundException: d:\ajax\menu.txt (系统找不到指定的路径。)
//如果 加个文件是否存在的判断,如不存在就在当前目录新建一个,则更好。
appendMethod("d:/menu.txt",message);
}
}
public static List<String> fileList = new ArrayList<String>();
/**
*
* @param path 文件路径
* @param suffix 后缀名
* @param isdepth 是否遍历子目录
* @return
*/
public static List getListFiles(String path, String suffix, boolean isdepth)
{
File file = new File(path);
return FileViewer.listFile(file ,suffix, isdepth);
}
public static List listFile(File f, String suffix, boolean isdepth)
{
//是目录,同时需要遍历子目录
if (f.isDirectory() && isdepth == true)
{
File[] t = f.listFiles();
for (int i = 0; i < t.length; i++)
{
listFile(t[i], suffix, isdepth);
}
}
else
{
String filePath = f.getAbsolutePath();
System.out.println("suffix = "+suffix);
if(suffix =="" || suffix == null)
{
//后缀名为null则为所有文件
System.out.println("----------------");
fileList.add(filePath);
}
else
{
int begIndex = filePath.lastIndexOf(".");//最后一个.(即后缀名前面的.)的索引
String tempsuffix = "";
if(begIndex != -1)//防止是文件但却没有后缀名结束的文件
{
tempsuffix = filePath.substring(begIndex + 1, filePath.length());
}
if(tempsuffix.equals(suffix))
{
fileList.add(filePath);
}
System.out.println("|||||||||||||||||||");
}
}
return fileList;
}
/**
* 方法追加文件:使用FileWriter
* @param fileName
* @param content
*/
public static void appendMethod(String fileName, String content)
{
try
{
//打开一个写文件器,构造函数中的第二个参数true表示以追加形式写文件
FileWriter writer = new FileWriter(fileName, true);
writer.write(content + "\r\n");
writer.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
⑶ java 最短路径算法 如何实现有向 任意两点的最短路径
Dijkstra(迪杰斯特拉)算法是典型的最短路径路由算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。
Dijkstra一般的表述通常有两种方式,一种用永久和临时标号方式,一种是用OPEN, CLOSE表方式
用OPEN,CLOSE表的方式,其采用的是贪心法的算法策略,大概过程如下:
1.声明两个集合,open和close,open用于存储未遍历的节点,close用来存储已遍历的节点
2.初始阶段,将初始节点放入close,其他所有节点放入open
3.以初始节点为中心向外一层层遍历,获取离指定节点最近的子节点放入close并从新计算路径,直至close包含所有子节点
代码实例如下:
Node对象用于封装节点信息,包括名字和子节点
[java] view plain
public class Node {
private String name;
private Map<Node,Integer> child=new HashMap<Node,Integer>();
public Node(String name){
this.name=name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Map<Node, Integer> getChild() {
return child;
}
public void setChild(Map<Node, Integer> child) {
this.child = child;
}
}
MapBuilder用于初始化数据源,返回图的起始节点
[java] view plain
public class MapBuilder {
public Node build(Set<Node> open, Set<Node> close){
Node nodeA=new Node("A");
Node nodeB=new Node("B");
Node nodeC=new Node("C");
Node nodeD=new Node("D");
Node nodeE=new Node("E");
Node nodeF=new Node("F");
Node nodeG=new Node("G");
Node nodeH=new Node("H");
nodeA.getChild().put(nodeB, 1);
nodeA.getChild().put(nodeC, 1);
nodeA.getChild().put(nodeD, 4);
nodeA.getChild().put(nodeG, 5);
nodeA.getChild().put(nodeF, 2);
nodeB.getChild().put(nodeA, 1);
nodeB.getChild().put(nodeF, 2);
nodeB.getChild().put(nodeH, 4);
nodeC.getChild().put(nodeA, 1);
nodeC.getChild().put(nodeG, 3);
nodeD.getChild().put(nodeA, 4);
nodeD.getChild().put(nodeE, 1);
nodeE.getChild().put(nodeD, 1);
nodeE.getChild().put(nodeF, 1);
nodeF.getChild().put(nodeE, 1);
nodeF.getChild().put(nodeB, 2);
nodeF.getChild().put(nodeA, 2);
nodeG.getChild().put(nodeC, 3);
nodeG.getChild().put(nodeA, 5);
nodeG.getChild().put(nodeH, 1);
nodeH.getChild().put(nodeB, 4);
nodeH.getChild().put(nodeG, 1);
open.add(nodeB);
open.add(nodeC);
open.add(nodeD);
open.add(nodeE);
open.add(nodeF);
open.add(nodeG);
open.add(nodeH);
close.add(nodeA);
return nodeA;
}
}
图的结构如下图所示:
Dijkstra对象用于计算起始节点到所有其他节点的最短路径
[java] view plain
public class Dijkstra {
Set<Node> open=new HashSet<Node>();
Set<Node> close=new HashSet<Node>();
Map<String,Integer> path=new HashMap<String,Integer>();//封装路径距离
Map<String,String> pathInfo=new HashMap<String,String>();//封装路径信息
public Node init(){
//初始路径,因没有A->E这条路径,所以path(E)设置为Integer.MAX_VALUE
path.put("B", 1);
pathInfo.put("B", "A->B");
path.put("C", 1);
pathInfo.put("C", "A->C");
path.put("D", 4);
pathInfo.put("D", "A->D");
path.put("E", Integer.MAX_VALUE);
pathInfo.put("E", "A");
path.put("F", 2);
pathInfo.put("F", "A->F");
path.put("G", 5);
pathInfo.put("G", "A->G");
path.put("H", Integer.MAX_VALUE);
pathInfo.put("H", "A");
//将初始节点放入close,其他节点放入open
Node start=new MapBuilder().build(open,close);
return start;
}
public void computePath(Node start){
Node nearest=getShortestPath(start);//取距离start节点最近的子节点,放入close
if(nearest==null){
return;
}
close.add(nearest);
open.remove(nearest);
Map<Node,Integer> childs=nearest.getChild();
for(Node child:childs.keySet()){
if(open.contains(child)){//如果子节点在open中
Integer newCompute=path.get(nearest.getName())+childs.get(child);
if(path.get(child.getName())>newCompute){//之前设置的距离大于新计算出来的距离
path.put(child.getName(), newCompute);
pathInfo.put(child.getName(), pathInfo.get(nearest.getName())+"->"+child.getName());
}
}
}
computePath(start);//重复执行自己,确保所有子节点被遍历
computePath(nearest);//向外一层层递归,直至所有顶点被遍历
}
public void printPathInfo(){
Set<Map.Entry<String, String>> pathInfos=pathInfo.entrySet();
for(Map.Entry<String, String> pathInfo:pathInfos){
System.out.println(pathInfo.getKey()+":"+pathInfo.getValue());
}
}
/**
* 获取与node最近的子节点
*/
private Node getShortestPath(Node node){
Node res=null;
int minDis=Integer.MAX_VALUE;
Map<Node,Integer> childs=node.getChild();
for(Node child:childs.keySet()){
if(open.contains(child)){
int distance=childs.get(child);
if(distance<minDis){
minDis=distance;
res=child;
}
}
}
return res;
}
}
Main用于测试Dijkstra对象
[java] view plain
public class Main {
public static void main(String[] args) {
Dijkstra test=new Dijkstra();
Node start=test.init();
test.computePath(start);
test.printPathInfo();
}
}
⑷ JAVA文件目录遍历缩进算法
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.FileFilter;
import java.util.Enumeration;
import java.util.Vector;
import javax.swing.*;
import javax.swing.tree.*;
public class MainFrame extends JFrame {
private JScrollPane imagesp = new JScrollPane();
private JTree tree = new JTree(FileTreeNode.ROOT);
private TreePath lastFilePath;
private JButton scaleB = new JButton("放大");
private JButton scaleS = new JButton("缩小");
private Image img;
private float beishu = 1;
public static void main(String[] args) {
new MainFrame();
}
public MainFrame () {
scaleB.setEnabled(false);
scaleS.setEnabled(false);
this.setSize(400,400);
this.setLayout(new BorderLayout());
JPanel centerPanel = new JPanel();
centerPanel.setLayout(new GridLayout(1,2));
JScrollPane treesp = new JScrollPane();
treesp.setViewportView(tree);
centerPanel.add(treesp);
tree.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent event) {
TreePath treePath = tree.getSelectionPath();
if(treePath!=lastFilePath) {
FileTreeNode node = (FileTreeNode)treePath.getLastPathComponent();
if(node.isFile()) {
String fpath = node.getPath();
lastFilePath = treePath;
img = Toolkit.getDefaultToolkit().createImage(fpath);
imagesp.setViewportView(new JLabel(new ImageIcon(img)));
beishu = 1;
imagesp.repaint();
scaleB.setEnabled(true);
scaleS.setEnabled(true);
}
}
}
});
centerPanel.add(imagesp);
this.add(centerPanel,BorderLayout.CENTER);
JPanel btnPanel = new JPanel();
btnPanel.add(scaleB);
btnPanel.add(scaleS);
scaleB.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
beishu*=2;
Image scaleIMG = img.getScaledInstance((int)(img.getWidth(imagesp)*beishu), (int)(img.getHeight(imagesp)*beishu), Image.SCALE_DEFAULT);
imagesp.setViewportView(new JLabel(new ImageIcon(scaleIMG)));
imagesp.repaint();
}
});
scaleS.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
beishu/=2;
Image scaleIMG = img.getScaledInstance((int)(img.getWidth(imagesp)*beishu), (int)(img.getHeight(imagesp)*beishu), Image.SCALE_DEFAULT);
imagesp.setViewportView(new JLabel(new ImageIcon(scaleIMG)));
imagesp.repaint();
}
});
this.add(btnPanel,BorderLayout.SOUTH);
this.setVisible(true);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
}
}
class FileTreeNode implements TreeNode {
private String name;
private String path;
private boolean isFile;
private Vector<FileTreeNode> children;
private FileTreeNode parent;
private final static ImageFileFilter filter = new ImageFileFilter();
public final static FileTreeNode ROOT = new FileTreeNode("我的电脑","",null);
private FileTreeNode(String name, String path, FileTreeNode parent) {
this.name = name;
this.path = path;
this.parent = parent;
File f = new File(path);
if(f.isFile())isFile = true;
else isFile = false;
}
public Enumeration<FileTreeNode> children() {
if(children==null)initChild();
return children.elements();
}
public String getName() {
return name;
}
public String getPath() {
return path;
}
public boolean isFile() {
return isFile;
}
public boolean getAllowsChildren() {
return !isFile;
}
public TreeNode getChildAt(int childIndex) {
if(children==null)initChild();
return children.elementAt(childIndex);
}
public int getChildCount() {
if(children==null)initChild();
return children.size();
}
public int getIndex(TreeNode node) {
return children.indexOf(node);
}
public TreeNode getParent() {
return parent;
}
public boolean isLeaf() {
return isFile;
}
public String toString() {
return name;
}
private void initChild() {
if(this==ROOT) {
children = new Vector<FileTreeNode>();
File[] files = File.listRoots();
for(int i=0;i<files.length;i++) {
FileTreeNode child = new FileTreeNode(files[i].getPath(),files[i].getPath(),this);
children.add(child);
}
}else {
children = new Vector<FileTreeNode>();
File current = new File(path);
if(current.isDirectory()) {
File[] files = current.listFiles(filter);//filefilter to add
for(int i=0;i<files.length;i++) {
FileTreeNode child = new FileTreeNode(files[i].getName(),files[i].getPath(),this);
children.add(child);
}
}
}
}
}
class ImageFileFilter implements FileFilter {
public boolean accept(File pathname) {
if(pathname.isDirectory())return true;
else {
String name = pathname.getName();
return match(name);
}
}
private boolean match(String name) {
if(name.endsWith("jpg"))return true;
else if(name.endsWith("gif"))return true;
else if(name.endsWith("bmp"))return true;
return false;
}
}
其实是给另一个问题写的,不过别个已经结了。损失好多分呀。
现在只显示3种文件类型,把FileFilter去掉就行了。
⑸ java遍历一个目录,输出这个那些最少一个文件的那些目录的绝对路径,这道题如何用java代码解决
我就不多说了,直接上代码吧:
/**
*java遍历一个目录,输出这个那些最少一个文件的那些目录的绝对路径,这道题如何用java代码解决?
*
*@paramargs
*/
publicstaticvoidmain(String[]args){
//设置文件目录,设置为user.dir目录,便于测试
Filefolder=newFile(System.getProperty("user.dir"));
System.out.println("根目录:"+folder.getAbsolutePath());
System.out.println("---------------------------------------------------------------------------");
(folder);
System.out.println("---------------------------------------------------------------------------");
}
/**
*显示有一个文件以上的文件目录
*@paramfile文件或目录
*/
privatestaticvoid(Filefile){
if(file!=null){
if(file.isDirectory()){//只有目录才处理
File[]files=file.listFiles();
intfileCount=0;//文件数量,即不是文件夹的数量
if(null!=files&&files.length>0){
for(FilesubFile:files){
if(subFile.isFile()){
fileCount++;//文件数目加一
}else{
//继续检查下面的文件夹
(subFile);
}
}
}
if(fileCount>0){//说明有文件,需要显示文件夹的全路径
System.out.println(file.getAbsolutePath()+":共有文件"+fileCount+"个!");
}
}
}
}
在我机器上的运行结果为:
⑹ JAVA7如何遍历一个目录下的所有文件,如何知
1.遍历本目录下所有的文件(不包括目录的目录里的文件)
import java.io.File;public class main { public static void main(String[] args) { String path = "D:\\JAVA"; //要遍历的路径 File file = new File(path); //获取其file对象 File[] fs = file.listFiles(); //遍历path下的文件和目录,放在File数组中 for(File f:fs){ //遍历File[]数组 if(!f.isDirectory()) //若非目录(即文件),则打印 System.out.println(f); } }}
运行结果:
打印出 D:/JAVA下的全部文件(包括D:/JAVA下的目录下的文件)
1.遍历本目录下所有的文件(包括目录的目录里的文件)
import java.io.File;import java.io.FileFilter;public class FileText { public static void main(String[] args) { String path = "D:\\JAVA"; //要遍历的路径 File file = new File(path); //获取其file对象 func(file); } private static void func(File file){ File[] fs = file.listFiles(); for(File f:fs){ if(f.isDirectory()) //若是目录,则递归打印该目录下的文件 func(f); if(f.isFile()) //若是文件,直接打印 System.out.println(f); } }}
打印结果:
打印所有文件
⑺ 在java中如何遍历某个路径下的所有文件夹和文件
首先,我们先来遍历一下D盘根目录下所有的子文件:public
static
void
fileList()
{
File
file=new
File("d:/");
File[]
files
=
file.listFiles();
if
(files
!=
null)
{
for
(File
f
:
files)
{
System.out.println(f.getPath());
}
}
}对此,我们肯定不满足,我们需要遍历D盘下所有的文件和文件夹,而不是根目录下的文件夹,这个时候我们需要使用到递归:public
static
void
fileList(File
file)
{
File[]
files
=
file.listFiles();
if
(files
!=
null)
{
for
(File
f
:
files)
{
System.out.println(f.getPath());
fileList(f);
}
}
}然后在主函数中调用:public
static
void
main(String[]
args)
{
File
file=new
File("d:/");
fileList(file);
}结果是不是能令你满意呢?显然,输出的都是全路径,我们可以对我们的递归函数做如下改进:
public
static
void
fileList(File
file,int
node)
{
node++;
File[]
files
=
file.listFiles();
if
(files
!=
null)
{
for
(File
f
:
files)
{
for(int
i=0;i<node;i++){
if(i==node-1){
System.out.print("├");
}
else{
System.out.print("
");
}
}
System.out.println(f.getName());
fileList(f,node);
}
}
}然后再次在主函数中调用:public
static
void
main(String[]
args)
{
File
file=new
File("d:/");
fileList(file,0);
}得到的结果是一个类似树状的结构,如果你对此还不满意,可以尝试给JTree上添加节点,可以做到和资源管理器中一样的结构。
⑻ 用java怎么遍历磁盘上的所有文件
首先,我们需要获取磁盘中所有的盘符路径:jdk6中一个方法搞定:
File[]roots=File.listRoots();
然后,通过每个路径来进行向下遍历,上代码(手敲,各种小错误别怪我,看思路就好):
importjava.io.File;
/**
由于本人使用了junit,请自行添加main方法测试
*/
publicclassTest{
@org.junit.Test
publicvoidtestfiles(){
File[]roots=File.listRoots();
for(Filef:roots){
System.out.println(f.getAbsolutePath());
}
listFiles(roots);
}
publicvoidlistFiles(File[]files){
if(files==null||files.length==0)return;
for(Filef:files){
if(f.isDirectory()){
System.out.println(f.getAbsolutePath());
listFiles(f.listFiles());
}else{
System.out.println(" |"+f.getName());
}
}
}
}
⑼ java中如何遍历最短路径长度邻接矩阵
packagetest;
importjava.util.ArrayList;
importjava.util.List;
/**
*java-用邻接矩阵求图的最短路径、最长途径。弗洛伊德算法
*/
publicclassFloydInGraph{
privatestaticintINF=Integer.MAX_VALUE;
privateint[][]dist;
privateint[][]path;
privateList<Integer>result=newArrayList<Integer>();
publicFloydInGraph(intsize){
this.path=newint[size][size];
this.dist=newint[size][size];
}
publicvoidfindPath(inti,intj){
intk=path[i][j];
if(k==-1)return;
findPath(i,k);
result.add(k);
findPath(k,j);
}
publicvoidfindCheapestPath(intbegin,intend,int[][]matrix){
floyd(matrix);
result.add(begin);
findPath(begin,end);
result.add(end);
}
publicvoidfloyd(int[][]matrix){
intsize=matrix.length;
for(inti=0;i<size;i++){
for(intj=0;j<size;j++){
path[i][j]=-1;
dist[i][j]=matrix[i][j];
}
}
for(intk=0;k<size;k++){
for(inti=0;i<size;i++){
for(intj=0;j<size;j++){
if(dist[i][k]!=INF&&
dist[k][j]!=INF&&
dist[i][k]+dist[k][j]<dist[i][j]){//dist[i][k]+dist[k][j]>dist[i][j]-->longestPath
dist[i][j]=dist[i][k]+dist[k][j];
path[i][j]=k;
}
}
}
}
}
publicstaticvoidmain(String[]args){
FloydInGraphgraph=newFloydInGraph(5);
int[][]matrix={
{INF,30,INF,10,50},
{INF,INF,60,INF,INF},
{INF,INF,INF,INF,INF},
{INF,INF,INF,INF,30},
{50,INF,40,INF,INF},
};
intbegin=0;
intend=4;
graph.findCheapestPath(begin,end,matrix);
List<Integer>list=graph.result;
System.out.println(begin+"to"+end+",thecheapestpathis:");
System.out.println(list.toString());
System.out.println(graph.dist[begin][end]);
}
}
为了避免目录列举消耗时间过长,请指定一个目录来模拟,命令行参数:代表路径的字符串.
如果认可代码,请加分50,谢谢
----
import javax.swing.*;
import javax.swing.tree.*;
import java.awt.*;
import java.io.*;
final public class FileTree extends JFrame {
public FileTree(File dir) throws HeadlessException {
super("File Tree");
JTree tree;
add(new JScrollPane(tree =new JTree(buildTreeModel(dir))));
tree.setCellRenderer(new FileTreeRenderer());
setSize(400,600);
setVisible(true);
}
private TreeModel buildTreeModel(File dir){
DefaultMutableTreeNode root = new DefaultMutableTreeNode(dir);
walkthrough(dir,root);
return new DefaultTreeModel(root);
}
private static void walkthrough(File f,DefaultMutableTreeNode node){
for (File fle : f.listFiles()) {
DefaultMutableTreeNode n = new DefaultMutableTreeNode(fle);
node.add(n);
if (fle.isDirectory()){
walkthrough(fle, n);
}
}
}
private class FileTreeRenderer extends DefaultTreeCellRenderer {
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
JLabel cmp = (JLabel)super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
if (value instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode n = (DefaultMutableTreeNode)value;
Object obj = n.getUserObject();
if (obj instanceof File) {
File f = (File)obj;
cmp.setText(f.getName());
cmp.setForeground(f.isDirectory()?Color.BLUE:Color.BLACK);
}
}
return cmp;
}
}
public static void main(String[] args) {
new FileTree(new File(args[0]));
}
}