File curDir = getCurDirectoryFile();
System.out.println("Current working directory : " + curDir);
System.out.println("Current working directory last modified on : " + new Date(curDir.lastModified()));
}
public static File getCurDirectoryFile() { return new File(getCurDirectory());
}
public static String getCurDirectory() { return System.getProperty("user.dir");
}
}
It gives the following output,
Current working directory : C:\io_tests
Current working directory last modified on : Mon Apr 18 15:52:20 IST 2011