Package h07

Class Installer


  • public class Installer
    extends Object
    Installer for the community tests.

    This is a standalone class that can download all necessary files to run tests for this assignment. More specifically, it can download all files whose hashes are listed in .test_metadata.xml. This class can also be used to reset or rather re-download files that have become corrupted or have otherwise been modified.

    It is important that the working directory is the same as the project root directory when running main(String[]), otherwise the files might be downloaded to the wrong location or even overwrite other files!
    • Constructor Detail

      • Installer

        public Installer()
    • Method Detail

      • main

        public static void main​(String[] args)
                         throws Exception
        Test installer / downloader
        Parameters:
        args - An array of filenames to download. All filenames have to be relative to project root. If any are given, only those will be downloaded (and overwritten). If none are given, all files whose hashes are in .test_metadata.xml will be downloaded (and overwritten).
        Throws:
        Exception
      • updateLocal

        private static void updateLocal​(String fileName)
                                 throws IOException,
                                        InterruptedException
        Creates (or overwrites) the specified file with the contents of the file at the repository. All missing directories will be created automatically.
        Parameters:
        fileName - The file with path relative to project root.
        Throws:
        IOException
        InterruptedException