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

redis.embedded.RedisRunScriptEnum Maven / Gradle / Ivy

There is a newer version: 0.11.0
Show newest version
package redis.embedded;

/**
* Created by piotrturek on 22/01/15.
*/
enum RedisRunScriptEnum {
    WINDOWS_64("redis-server.exe"),
    UNIX("redis-server"),
    MACOSX("redis-server.app");

    private final String runScript;

    private RedisRunScriptEnum(String runScript) {
        this.runScript = runScript;
    }

    public static String getRedisRunScript() {
        String osName = System.getProperty("os.name").toLowerCase();
        String osArch = System.getProperty("os.arch").toLowerCase();

        if (osName.contains("win") && osArch.contains("64")) {
            return WINDOWS_64.runScript;
        } else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) {
            return UNIX.runScript;
        } else if ("Mac OS X".equalsIgnoreCase(osName)) {
            return MACOSX.runScript;
        } else {
            throw new RuntimeException("Unsupported os/architecture...: " + osName + " on " + osArch);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy