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

io.github.eliux.mega.platform.OSPlatform Maven / Gradle / Ivy

Go to download

Java client library that works on top of MEGAcmd to provide access to the services of Mega.nz

The newest version!
package io.github.eliux.mega.platform;

/**
 * Abstractions to encapsulate Operative System/Platforms specific actions.
 * E.g.: Running the MEGAcmd commands.
 */
public abstract class OSPlatform {

    private static OSPlatform current;

    public static OSPlatform getCurrent() {
        if (current == null) {
            if (isWindows()) {
                current = new WindowsPlatform();
            } else {
                current = new UnixPlatform();
            }
        }

        return current;
    }

    protected OSPlatform() {
    }

    public static boolean isWindows() {
        return System.getProperty("os.name").toLowerCase().startsWith("windows");
    }

    abstract public String cmdInstruction(String cmd);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy