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

io.github.eliux.mega.cmd.AbstractMegaCmd Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.6.2
Show newest version
package io.github.eliux.mega.cmd;

import io.github.eliux.mega.MegaUtils;
import io.github.eliux.mega.platform.OSPlatform;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public abstract class AbstractMegaCmd {

    protected List executableCommand() {
        final String[] cmdInstructions = MegaUtils.convertInstructionsToExecParams(
            getCmdAdaptedToPlatform()
        );
        return Arrays.asList(cmdInstructions);
    }

    protected String[] executableCommandArray(){
        final List execCmd = executableCommand();

        String[] execCmdArray = new String[execCmd.size()];
        execCmd.toArray(execCmdArray);

        return execCmdArray;
    }

    protected String getCmdAdaptedToPlatform() {
        return OSPlatform.getCurrent().cmdInstruction(getCmd());
    }

    public abstract String getCmd();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy