Tabnine Logo
WebClient
Code IndexAdd Tabnine to your IDE (free)

How to use
WebClient
in
de.dytanic.cloudnet.web.client

Best Java code snippets using de.dytanic.cloudnet.web.client.WebClient (Showing top 6 results out of 315)

origin: Dytanic/CloudNet

/**
 * Loads the latest version of the cloud for comparison.
 *
 * @return the latest version of the cloud
 */
public String getNewstVersion()
{
  return getString(DEFAULT_URL + "update/config.json", "version");
}
origin: Dytanic/CloudNet

public void checkForUpdates()
{
  if (!wrapperConfig.isAutoUpdate()) return;
  String version = webClient.getNewstVersion();
  if (version != null)
  {
    if (!version.equals(CloudNetWrapper.class.getPackage().getImplementationVersion()))
    {
      System.out.println("Preparing update...");
      webClient.update(version);
      shutdown();
    } else System.out.println("No updates found!");
  } else System.out.println("Failed to check for updates");
}
origin: Dytanic/CloudNet

/**
 * Loads all official modules
 *
 * @return a collection containing all official plugins.
 */
public Collection<String> getInstallableModules()
{
  return handleRequest(DEFAULT_URL + "modules", new TypeToken<Collection<String>>() {
  }.getType());
}
origin: Dytanic/CloudNet

HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(DEFAULT_URL + "update/" + (getEnvironment() ? "CloudNet-Master.jar" : "CloudNet-Wrapper.jar")).openConnection();
httpURLConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11");
httpURLConnection.setUseCaches(false);
      Paths.get("CloudNet-" + (getEnvironment() ? "Master" : "Wrapper") + "-Update#" + version + "-" + NetworkUtils.RANDOM.nextLong() + ".jar")
origin: Dytanic/CloudNet

public void checkForUpdates()
{
  if (!config.isAutoUpdate()) return;
  String version = webClient.getNewstVersion();
  if (version != null)
  {
    if (!version.equals(CloudNet.class.getPackage().getImplementationVersion()))
    {
      System.out.println("Preparing update...");
      webClient.update(version);
      shutdown();
    } else System.out.println("No updates were found!");
  } else System.out.println("Failed to check for updates");
}
origin: Dytanic/CloudNet

/**
 * Loads all official templates
 *
 * @return a collection containing all official templates.
 */
public Collection<String> getInstallableTemplates()
{
  return handleRequest(DEFAULT_URL + "templates", new TypeToken<Collection<String>>() {
  }.getType());
}
de.dytanic.cloudnet.web.clientWebClient

Most used methods

  • getNewstVersion
    Loads the latest version of the cloud for comparison.
  • update
    Update the master or wrapper, depending on the environment
  • getEnvironment
    Checks for the CloudNet environment
  • getString
    Downloads JSON data from the given url and returns the given key as a string.
  • handleRequest
    Handles a request and downloads JSON from url and parses it as type

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now