public class Installer
extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DATA_ZIP |
static String |
JARS_ZIP |
static boolean |
KEEP_ZIP_FILES |
static String |
MD5_FILE_NAME |
static String |
RELEASE |
static String |
REPO |
static boolean |
SKIP_TEST |
static boolean |
SKIP_ZIP_DOWNLOAD |
static boolean |
verbose |
Constructor and Description |
---|
Installer() |
Modifier and Type | Method and Description |
---|---|
static String |
bytesToString(byte[] checksum)
Convert bytes of an MD5 checksum into common alpha-numeric String representation.
|
static String |
calculateMD5OfFile(Path path)
Performs an MD5 checksum on the provided file and returns the result.
|
static String |
calculateMD5OfFile(String fileName)
Performs an MD5 checksum on the provided file and returns the result.
|
static String |
calculateMD5OfStream(InputStream is)
Performs an MD5 checksum on the provided input stream and returns the result.
|
static long |
downloadFile(String url,
String dstFileName)
Downloads a file specified by the URL to the local file dstFileName.
|
static List<String> |
getAllJavaSources(String dir)
Gets all Java (.java) source files recursively under the
provided directory
|
static String |
getExpectedMD5(String releaseName,
String fileName) |
static String |
getJarsClasspath()
Identifies all necessary jar files in /jars directory and creates a CLASSPATH string.
|
static boolean |
isWindows() |
static void |
main(String[] args) |
static Integer |
runCommand(List<String> command) |
static void |
unzipFile(String zipFile,
String destDir)
Unzips a file into a specified directory
|
static void |
updateJars() |
static boolean |
validateMD5OfDownloadedFile(String releaseDir,
String downloadedFileName)
Validates an already downloaded RapidWright release file using the MD5 hash
|
public static boolean verbose
public static boolean KEEP_ZIP_FILES
public static boolean SKIP_ZIP_DOWNLOAD
public static boolean SKIP_TEST
public static String MD5_FILE_NAME
public static final String REPO
public static final String RELEASE
public static final String DATA_ZIP
public static final String JARS_ZIP
public static String bytesToString(byte[] checksum)
checksum
- The digested result from an MD5 instance.public static String calculateMD5OfFile(String fileName)
fileName
- Name of the file on which to perform the checksumpublic static String calculateMD5OfFile(Path path)
path
- Path of the file on which to perform the checksumpublic static String calculateMD5OfStream(InputStream is)
public static boolean validateMD5OfDownloadedFile(String releaseDir, String downloadedFileName)
releaseDir
- The URL of the release directorydownloadedFileName
- The name of the local filepublic static long downloadFile(String url, String dstFileName)
url
- The target URL to downloaddstFileName
- The local file namepublic static void unzipFile(String zipFile, String destDir)
zipFile
- Name of the zip file to unzipdestDir
- The directory to receive the contents of the zip filepublic static Integer runCommand(List<String> command)
public static boolean isWindows()
public static String getJarsClasspath()
public static List<String> getAllJavaSources(String dir)
dir
- The directory to look under for Java source filespublic static String getExpectedMD5(String releaseName, String fileName)
public static void updateJars()
public static void main(String[] args) throws IOException
IOException