Class ExternalFile
java.lang.Object
fr.flowarg.flowupdater.download.json.ExternalFile
This class represents an external file object.
-
Constructor Summary
ConstructorsConstructorDescriptionExternalFile(String path, String downloadURL, String sha1, long size) Construct a new ExternalFile object.ExternalFile(String path, String downloadURL, String sha1, long size, boolean update) Construct a new ExternalFile object. -
Method Summary
Modifier and TypeMethodDescriptionGet the url of the external file.static @NotNull List<ExternalFile>getExternalFilesFromJson(String jsonUrl) Provide a List of external file from a JSON file.static @NotNull List<ExternalFile>getExternalFilesFromJson(URL jsonUrl) Provide a List of external file from a JSON file.getPath()Get the path of the external file.getSha1()Get the sha1 of the external file.longgetSize()Get the size of the external file.booleanisUpdate()ShouldExternalFileDeletercheck the file?
-
Constructor Details
-
ExternalFile
Construct a new ExternalFile object.- Parameters:
path- Path of external file.sha1- Sha1 of external file.size- Size of external file.downloadURL- external file URL.
-
ExternalFile
Construct a new ExternalFile object.- Parameters:
path- Path of external file.sha1- Sha1 of external file.size- Size of external file.downloadURL- external file URL.update- false: not checking if the file is valid. true: checking if the file is valid.
-
-
Method Details
-
getExternalFilesFromJson
Provide a List of external file from a JSON file. Template of a JSON file :{ "extfiles": [ { "path": "other/path/AnExternalFile.binpatch", "downloadURL": "https://url.com/launcher/extern/AnExtFile.binpatch", "sha1": "40f784892989du0fc6f45c895d4l6c5db9378f48", "size": 25652 }, { "path": "config/config.json", "downloadURL": "https://url.com/launcher/ext/modconfig.json", "sha1": "eef74b3fbab6400cb14b02439cf092cca3c2125c", "size": 19683, "update": false } ] }- Parameters:
jsonUrl- the JSON file URL.- Returns:
- an external file list.
-
getExternalFilesFromJson
Provide a List of external file from a JSON file.- Parameters:
jsonUrl- the JSON file URL.- Returns:
- an external file list.
-
getPath
Get the path of the external file.- Returns:
- the path of the external file.
-
getDownloadURL
Get the url of the external file.- Returns:
- the url of the external file.
-
getSha1
Get the sha1 of the external file.- Returns:
- the sha1 of the external file.
-
getSize
public long getSize()Get the size of the external file.- Returns:
- the size of the external file.
-
isUpdate
public boolean isUpdate()ShouldExternalFileDeletercheck the file?- Returns:
- if the external file deleter should check and delete the file.
-