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

io.github.eliux.mega.cmd.MegaCmdCopy 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.cmd;

import io.github.eliux.mega.MegaUtils;

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

public class MegaCmdCopy extends AbstractMegaCmdRunnerWithParams {

  private final String sourceRemotePath;

  private final String remoteTarget;

  public MegaCmdCopy(String sourceRemotePath, String remoteTarget) {
    this.sourceRemotePath = sourceRemotePath;
    this.remoteTarget = remoteTarget;
  }

  @Override
  List cmdParams() {
    return Arrays.asList(sourceRemotePath, remoteTarget);
  }

  @Override
  public String getCmd() {
    return "cp";
  }

  public String getSourceRemotePath() {
    return sourceRemotePath;
  }

  public String getRemoteTarget() {
    return remoteTarget;
  }

  public boolean isRemoteTargetAUser() {
    return MegaUtils.isEmail(remoteTarget);
  }

  public boolean isRemoteTargetADirectory() {
    return MegaUtils.isDirectory(remoteTarget);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy