Search in sources :

Example 1 with SolderPackInfo

use of net.technicpack.solder.io.SolderPackInfo in project LauncherV3 by TechnicPack.

the class HttpSolderApi method internalGetPublicSolderPacks.

@Override
public Collection<SolderPackInfo> internalGetPublicSolderPacks(String solderRoot, ISolderApi packFactory) throws RestfulAPIException {
    LinkedList<SolderPackInfo> allPackApis = new LinkedList<SolderPackInfo>();
    String allPacksUrl = solderRoot + "modpack?include=full&cid=" + clientId;
    FullModpacks technic = RestObject.getRestObject(FullModpacks.class, allPacksUrl);
    for (SolderPackInfo info : technic.getModpacks().values()) {
        ISolderPackApi solder = packFactory.getSolderPack(solderRoot, info.getName(), technic.getMirrorUrl());
        info.setSolder(solder);
        allPackApis.add(info);
    }
    return allPackApis;
}
Also used : ISolderPackApi(net.technicpack.solder.ISolderPackApi) FullModpacks(net.technicpack.solder.io.FullModpacks) SolderPackInfo(net.technicpack.solder.io.SolderPackInfo) LinkedList(java.util.LinkedList)

Example 2 with SolderPackInfo

use of net.technicpack.solder.io.SolderPackInfo in project LauncherV3 by TechnicPack.

the class PlatformPackInfoRepository method getInfoFromPlatformInfo.

protected PackInfo getInfoFromPlatformInfo(PlatformPackInfo platformInfo) throws RestfulAPIException {
    if (platformInfo != null && platformInfo.hasSolder()) {
        try {
            ISolderPackApi solderPack = solder.getSolderPack(platformInfo.getSolder(), platformInfo.getName(), solder.getMirrorUrl(platformInfo.getSolder()));
            SolderPackInfo solderInfo = solderPack.getPackInfoForBulk();
            if (solderInfo == null)
                return platformInfo;
            else
                return new CombinedPackInfo(solderInfo, platformInfo);
        } catch (RestfulAPIException ex) {
            ex.printStackTrace();
            return platformInfo;
        }
    } else {
        return platformInfo;
    }
}
Also used : RestfulAPIException(net.technicpack.rest.RestfulAPIException) CombinedPackInfo(net.technicpack.launchercore.modpacks.packinfo.CombinedPackInfo) ISolderPackApi(net.technicpack.solder.ISolderPackApi) SolderPackInfo(net.technicpack.solder.io.SolderPackInfo)

Example 3 with SolderPackInfo

use of net.technicpack.solder.io.SolderPackInfo in project LauncherV3 by TechnicPack.

the class HttpSolderPackApi method getPackInfo.

@Override
public SolderPackInfo getPackInfo() throws RestfulAPIException {
    String packUrl = baseUrl + "modpack/" + modpackSlug + "?cid=" + clientId;
    SolderPackInfo info = RestObject.getRestObject(SolderPackInfo.class, packUrl);
    info.setSolder(this);
    return info;
}
Also used : SolderPackInfo(net.technicpack.solder.io.SolderPackInfo)

Aggregations

SolderPackInfo (net.technicpack.solder.io.SolderPackInfo)3 ISolderPackApi (net.technicpack.solder.ISolderPackApi)2 LinkedList (java.util.LinkedList)1 CombinedPackInfo (net.technicpack.launchercore.modpacks.packinfo.CombinedPackInfo)1 RestfulAPIException (net.technicpack.rest.RestfulAPIException)1 FullModpacks (net.technicpack.solder.io.FullModpacks)1