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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy