Class JavaFile

java.lang.Object
dev.treset.mcdl.json.GenericJsonParsable
dev.treset.mcdl.java.JavaFile
All Implemented Interfaces:
dev.treset.mcdl.json.JsonParsable

public class JavaFile extends dev.treset.mcdl.json.GenericJsonParsable
  • Constructor Details

  • Method Details

    • fromJson

      public static List<JavaFile> fromJson(String jsonManifest) throws dev.treset.mcdl.json.SerializationException
      Throws:
      dev.treset.mcdl.json.SerializationException
    • fromJsonObject

      public static JavaFile fromJsonObject(String name, com.google.gson.JsonObject jsonObject) throws dev.treset.mcdl.json.SerializationException
      Throws:
      dev.treset.mcdl.json.SerializationException
    • getAll

      public static List<JavaFile> getAll(String url) throws dev.treset.mcdl.exception.FileDownloadException
      Gets all java files from the specified URL
      Parameters:
      url - The URL to get the files from
      Returns:
      A list of java files
      Throws:
      dev.treset.mcdl.exception.FileDownloadException - If there is an error downloading or parsing the files
    • downloadAll

      public static void downloadAll(List<JavaFile> files, File baseDir, Consumer<dev.treset.mcdl.util.DownloadStatus> onStatus) throws dev.treset.mcdl.exception.FileDownloadException
      Downloads all the files to the specified directory
      Parameters:
      files - The files to download
      baseDir - The directory to download the files to
      onStatus - The status callback
      Throws:
      dev.treset.mcdl.exception.FileDownloadException - If there is an error downloading or writing a file
    • download

      public void download(File baseDir) throws dev.treset.mcdl.exception.FileDownloadException
      Downloads the file to the specified directory
      Parameters:
      baseDir - The directory to download the file to
      Throws:
      dev.treset.mcdl.exception.FileDownloadException - If there is an error downloading or writing the file
    • isFile

      public boolean isFile()
    • isDir

      public boolean isDir()
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • isExecutable

      public boolean isExecutable()
    • setExecutable

      public void setExecutable(boolean executable)
    • getType

      public String getType()
    • setType

      public void setType(String type)
    • getLzma

      public JavaDownload getLzma()
    • setLzma

      public void setLzma(JavaDownload lzma)
    • getRaw

      public JavaDownload getRaw()
    • setRaw

      public void setRaw(JavaDownload raw)