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