All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jtransc.JTranscSystemProperties Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.6.8
Show newest version
package com.jtransc;

public class JTranscSystemProperties {
	static public String fileEncoding() {
		return "UTF-8";
	}

	static public String userLanguage() {
		return "en";
	}

	static public String userRegion() {
		return "US";
	}

	static public String userVariant() {
		return "";
	}

	public static String tmpdir() {
		String out = getenvs(new String[]{"TMPDIR", "TEMP", "TMP"}, "/tmp");
		if (JTranscSystem.isWindows()) {
			if (!out.endsWith("/") || !out.endsWith("\\")) {
				out += "\\";
			}
		}
		return out;
	}

	public static String getenvs(String[] names, String defaultValue) {
		for (String name : names) {
			String out = System.getenv(name);
			if (out != null) return out;
		}
		return defaultValue;
	}

	public static String userHome() {
		return JTranscSystemProperties.getenvs(new String[]{"HOME"}, "/tmp");
	}

	public static String userDir() {
		return JTranscSystemProperties.getenvs(new String[]{"HOME"}, "/tmp");
	}

	public static String userName() {
		return JTranscSystemProperties.getenvs(new String[]{"USERNAME", "USER"}, "username");
	}

	public static String javaHome() {
		return "/tmp";
	}

	public static String fileSeparator() {
		//return isWindows() ? "\\" : "/";
		return "/";
	}

	public static String pathSeparator() {
		//return isWindows() ? ";" : ":";
		return ":";
	}

	public static String lineSeparator() {
		//return isWindows() ? "\r\n" : "\n";
		return "\n";
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy