Test.java : 


  import   java.io.*; 

  public   class   Test   { 

  public   static   void   main(String[]   args)   { 

  
File   directory =   new   File("."); 

  try   { 

  
File   newPath   =   new   File(directory.getCanonicalPath()+"/NewFolder");
  // 注意NewFolder 前面的斜线!!
  System.out.println(directory.getCanonicalPath()); 

 //读取properties 文件 

  File   pro = new File (directory.getCanonicalPath()+"aa.properties"); 

  pro.createNewFile(); 

  newPath.mkdir(); 

  }catch(Exception   exp) 

  { 

  exp.printStackTrace(); 

  } 

  } 

  }