public static String getSystemTmpDirectory () {

		if (systemTmpDir != null) {
			return (systemTmpDir);
		}
		
		String dir = getProperty("java.io.tmpdir");
		if (dir == null) {
			dir = getProperty("TMP");
		}
		if (dir == null) {
			dir = getProperty("TEMP");
		}
		if (dir == null) {
			dir = getProperty("TMPDIR");
		}

		if (dir != null) {
			systemTmpDir = dir;
			return (dir);
		}

		
		if (!isWindows()) {
			systemTmpDir = "/tmp";
			return (systemTmpDir);
		}

		String drive = getProperty("SystemDrive");
		if (drive != null) {
			char c = drive.charAt(drive.length() - 1);
			if (c != '\\' && c != '/') {
				systemTmpDir = drive + "\\TEMP";
			} else {
				systemTmpDir = drive + "TEMP";
			}

			return (systemTmpDir);
		} 

		systemTmpDir = "\\TEMP";
		return (systemTmpDir);
	}