Class LauncherDownloader
java.lang.Object
com.github.tadukoo.launcher.downloader.LauncherDownloader
public class LauncherDownloader
extends java.lang.Object
This class downloads the Tadukoo Launcher installer exe from GitHub (showing download
progress as it goes) and then runs that installer and exits this process.
- Version:
- 0.1-Alpha-SNAPSHOT
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Fields Modifier and Type Field Description private static long
bytesInGB
private static long
bytesInKB
private static long
bytesInMB
private static java.lang.String
fileName
private static long
fileSize
private static java.net.URL
fileURL
private static java.util.regex.Pattern
githubPattern
This pattern is used to grab the file size and download URL of the TadukooLauncher exe to install the Tadukoo Launcher.private static javax.swing.JProgressBar
progressBar
-
Constructor Summary
Constructors Constructor Description LauncherDownloader()
-
Method Summary
Modifier and Type Method Description private static void
downloadFile()
Download the file from GitHub, using theProgressReadableByteChannelWrapper
so that we can update the progress bar.static void
main(java.lang.String[] args)
static void
progressUpdate(double progress, long readSoFar, long expectedSize)
private static void
retrieveInfoFromGitHub()
Retrieves the file URL and size from GitHubprivate static void
setupFrame()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
githubPattern
private static final java.util.regex.Pattern githubPatternThis pattern is used to grab the file size and download URL of the TadukooLauncher exe to install the Tadukoo Launcher. This pattern matches against the JSON returned by GitHub's "latest release" endpoint. This is kinda a cheaty way to handle this, but I don't want to actually handle the JSON, as I'm trying to produce a smaller jar -
bytesInKB
private static final long bytesInKB- See Also:
- Constant Field Values
-
bytesInMB
private static final long bytesInMB- See Also:
- Constant Field Values
-
bytesInGB
private static final long bytesInGB- See Also:
- Constant Field Values
-
progressBar
private static javax.swing.JProgressBar progressBar -
fileURL
private static java.net.URL fileURL -
fileSize
private static long fileSize -
fileName
private static final java.lang.String fileName- See Also:
- Constant Field Values
-
-
Constructor Details
-
LauncherDownloader
public LauncherDownloader()
-
-
Method Details
-
main
public static void main(java.lang.String[] args) throws java.io.IOException- Throws:
java.io.IOException
-
setupFrame
private static void setupFrame() -
retrieveInfoFromGitHub
private static void retrieveInfoFromGitHub() throws java.io.IOExceptionRetrieves the file URL and size from GitHub- Throws:
java.io.IOException
- If most anything goes wrong
-
progressUpdate
public static void progressUpdate(double progress, long readSoFar, long expectedSize) -
downloadFile
private static void downloadFile() throws java.io.IOExceptionDownload the file from GitHub, using theProgressReadableByteChannelWrapper
so that we can update the progress bar.- Throws:
java.io.IOException
- If basically anything goes wrong
-