Package dev.treset.mcdl.java
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 Summary
ConstructorsConstructorDescriptionJavaFile(String name, boolean executable, String type, JavaDownload lzma, JavaDownload raw) -
Method Summary
Modifier and TypeMethodDescriptionvoidDownloads the file to the specified directorystatic voiddownloadAll(List<JavaFile> files, File baseDir, Consumer<dev.treset.mcdl.util.DownloadStatus> onStatus) Downloads all the files to the specified directorystatic JavaFilefromJsonObject(String name, com.google.gson.JsonObject jsonObject) Gets all java files from the specified URLgetLzma()getName()getRaw()getType()booleanisDir()booleanbooleanisFile()voidsetExecutable(boolean executable) voidsetLzma(JavaDownload lzma) voidvoidsetRaw(JavaDownload raw) voidMethods inherited from class dev.treset.mcdl.json.GenericJsonParsable
fromJson, fromJson, fromJson, fromJson, fromJsonArray, fromJsonArray, toJson, writeToFile
-
Constructor Details
-
JavaFile
-
-
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 downloadbaseDir- The directory to download the files toonStatus- The status callback- Throws:
dev.treset.mcdl.exception.FileDownloadException- If there is an error downloading or writing a file
-
download
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
-
setName
-
isExecutable
public boolean isExecutable() -
setExecutable
public void setExecutable(boolean executable) -
getType
-
setType
-
getLzma
-
setLzma
-
getRaw
-
setRaw
-