java.lang.Object
fr.flowarg.flowupdater.download.json.Mod
Direct Known Subclasses:
CurseModPack.CurseModPackMod

public class Mod extends Object
This class represents a Mod object.
  • Constructor Details

    • Mod

      public Mod(String name, String downloadURL, String sha1, long size)
      Construct a new Mod object.
      Parameters:
      name - Name of mod file.
      downloadURL - Mod download URL.
      sha1 - Sha1 of mod file.
      size - Size of mod file.
  • Method Details

    • getModsFromJson

      @NotNull public static @NotNull List<Mod> getModsFromJson(URL jsonUrl)
      Provide a List of Mods from a JSON file. Template of a JSON file :
       {
         "mods": [
           {
             "name": "KeyStroke",
             "downloadURL": "https://url.com/launcher/mods/KeyStroke.jar",
             "sha1": "70e564892989d8bbc6f45c895df56c5db9378f48",
             "size": 1234
           },
           {
             "name": "JourneyMap",
             "downloadURL": "https://url.com/launcher/mods/JourneyMap.jar",
             "sha1": "eef74b3fbab6400cb14b02439cf092cca3c2125c",
             "size": 1234
           }
         ]
       }
       
      Parameters:
      jsonUrl - the JSON file URL.
      Returns:
      a Mod list.
    • fromJson

      public static Mod fromJson(com.google.gson.JsonElement modElement)
    • getModsFromJson

      @NotNull public static @NotNull List<Mod> getModsFromJson(String jsonUrl)
      Provide a List of Mods from a JSON file. Template of a JSON file :
      Parameters:
      jsonUrl - the JSON file URL.
      Returns:
      a Mod list.
    • getName

      public String getName()
      Get the mod name.
      Returns:
      the mod name.
    • getSha1

      public String getSha1()
      Get the sha1 of the mod.
      Returns:
      the sha1 of the mod.
    • getSize

      public long getSize()
      Get the mod size.
      Returns:
      the mod size.
    • getDownloadURL

      public String getDownloadURL()
      Get the mod url.
      Returns:
      the mod url.