参考一下下面的代码:
  try {
     File f = new File("");
     String sPath = f.getAbsolutePath();
     File dir = new File(path);
     try {
         File[] files = dir.listFiles();
     }
     catch(SecurityException e1) {     }
  }
  catch (NullPointerException e2) {
      return;
  }files数组中存放的就是当前目录下所有的文件。