File Path = new File("..");//The current dir
if (Path.exists()){
  String[] fileList = delPath.list();
  for (int i = 0; i < fileList.length; i++) {
    System.out.println(fileList[i]); //print out all the filename and dir.
  }
}

解决方案 »

  1.   

    还是不行,就是new FileInputStream("configinfo.xml"),configinfo.xml和类在同一个目录,怎么也不行呀!快回答呀,给分了!:)
      

  2.   

    再检查一下,如果''configinfo.xml和类在同一个目录''
    new FileInputStream("configinfo.xml")应该能加载的
      

  3.   

    比如 configinfo.xml和类Test在同一个目录InputStream in = Test.class.getResourceAsStream("configinfo.xml");

    File file = new File( Test.class.getResource(("configinfo.xml").getPath());