public class WebClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_URL |
| Constructor and Description |
|---|
WebClient() |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
getEnvironment()
Checks for the CloudNet environment
|
Collection<String> |
getInstallableModules()
Loads all official modules
|
Collection<String> |
getInstallableTemplates()
Loads all official templates
|
String |
getNewstVersion()
Loads the latest version of the cloud for comparison.
|
private String |
getString(String url,
String key)
Downloads JSON data from the given
url and returns the given
key as a string. |
private <E> E |
handleRequest(String url,
Type type)
Handles a request and downloads JSON from
url and parses it as type |
void |
update(String version)
Update the master or wrapper, depending on the environment
|
void |
updateLocalCloudWrapper(Path outputPath)
Update the local wrapper (only on the master)
|
public static final String DEFAULT_URL
public Collection<String> getInstallableModules()
private <E> E handleRequest(String url, Type type)
url and parses it as typeE - the runtime type of the parsed jsonurl - the URL to download the JSON fromtype - the type of data to parse aspublic Collection<String> getInstallableTemplates()
public String getNewstVersion()
private String getString(String url, String key)
url and returns the given
key as a string.url - the URL to download the JSON data from.key - the key to read the data frompublic void update(String version)
version - the version to downloadgetEnvironment()private boolean getEnvironment()
public void updateLocalCloudWrapper(Path outputPath)
Copyright © 2020. All rights reserved.