io.github.eliux.mega.cmd.ImportInfo 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.error.MegaInvalidResponseException;
public class ImportInfo {
private String remotePath;
public ImportInfo(String remotePath) {
this.remotePath = remotePath;
}
public String getRemotePath() {
return remotePath;
}
public void setRemotePath(String remotePath) {
this.remotePath = remotePath;
}
public static ImportInfo parseImportInfo(String importInfoStr) {
try {
if (importInfoStr.contains("Imported folder complete:")) {
final String[] tokens = importInfoStr.split(": ");
return new ImportInfo(tokens[1]);
}
} catch (Exception e) {
throw new MegaInvalidResponseException(e.getMessage());
}
throw new MegaInvalidResponseException(importInfoStr);
}
}