public class JythonJarManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SOURCE_URL_STRING |
Constructor and Description |
---|
JythonJarManager() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkInstalled(boolean deleteIfWrongSize)
Checks whether the Jython jar file is installed locally and
has the correct size.
|
static boolean |
checkSha1Digest(boolean deleteIfIncorrect)
Calculates the SHA-1 digest of the Jython jar file and verified it
against a hard-coded reference value.
|
static void |
download()
Downloads the Jython jar from a hard-coded URL and saves it in
the application data directory.
|
static java.nio.file.Path |
getPath()
Returns the local path for the Jython jar file with the application data
directory.
|
public static final java.lang.String SOURCE_URL_STRING
public static java.nio.file.Path getPath() throws java.io.IOException
java.io.IOException
- if there was an error determining the pathpublic static boolean checkSha1Digest(boolean deleteIfIncorrect) throws java.io.IOException, java.security.NoSuchAlgorithmException
deleteIfIncorrect
- If this parameter is true, and if the SHA-1
digest is not correct, the jar file will be deletedjava.io.IOException
- if there was an error reading the jar filejava.security.NoSuchAlgorithmException
- if the SHA-1 algorithm was not availablepublic static boolean checkInstalled(boolean deleteIfWrongSize) throws java.io.IOException
deleteIfWrongSize
- if true, and if the jar file
does not have the correct size, it will be deleted.java.io.IOException
- if there was an error checking or deleting
the jar filepublic static void download() throws java.io.IOException
java.io.IOException
- if there is an error reading from the URL
or writing to the file