Revision as of 07:47, 4 December 2010 by Han84 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
public static String fileCurrentDirectory() {
	return System.getProperty("user.dir");
}
 
public static String fileCurrentDirectory2() {
	java.io.File f = new java.io.File(".");
	String path = null;
	try {
		path = f.getCanonicalPath();
	} catch (java.io.IOException ex) {
		Ts.printErr(ex);
	}
	return path;
}
 
public static void printErr(java.lang.Exception ex) {
	printErr(ex.getMessage());
}


Back to JavaHowTo

Alumni Liaison

Followed her dream after having raised her family.

Ruth Enoch, PhD Mathematics