background image

 
this.path=path;
  }
  /***
  * 返回当前目录路径
  */
  public String getDirectory(){
  return myDir.getPath();
  }
  /**
  * 刷新列表
  */
  public void refreshList(){
  if(this.path.equals("")) path="c:\\";
  myDir=new File(path);
  vectorList.clear();
  contents =myDir.listFiles();
  //重新装入路径下文件

  for(int i=0;i
  vectorList.add(contents[i]);
  }
  currentFileView=vectorList.iterator();
  }
  /**
  * 移动当前文件集合的指针指到下一个条目
  * @return 成功返回 true,否则 false
  */
  public boolean nextFile(){
  while(currentFileView.hasNext()){
  currentFile=(File)currentFileView.next();
  return true;
  }
  return false;
  }
  /**
  * 返回当前指向的文件对象的文件名称
  */
  public String getFileName(){
  return currentFile.getName();
  }
  /**
  * 返回当前指向的文件对象的文件尺寸