io.github.eliux.mega.MegaServer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of megacmd4j Show documentation
Show all versions of megacmd4j Show documentation
Java client library that works on top of MEGAcmd to provide access to the services of Mega.nz
package io.github.eliux.mega;
import io.github.eliux.mega.error.MegaUnexpectedFailureException;
import io.github.eliux.mega.platform.OSPlatform;
public class MegaServer {
private static MegaServer current;
public static MegaServer getCurrent() {
if (current == null) {
current = new MegaServer();
}
return current;
}
private MegaServer() {
}
public void start() {
try {
final String[] cmdParams = MegaUtils.convertInstructionsToExecParams(
OSPlatform.getCurrent().cmdInstruction("help")
);
MegaUtils.execCmd(cmdParams);
} catch (Exception e) {
throw new MegaUnexpectedFailureException();
}
}
public void stop() {
Mega.quit();
}
}