Class ExamplesInstaller

java.lang.Object
net.ssehub.easy.producer.examples.ExamplesInstaller

public class ExamplesInstaller extends Object
Methods for installing selected examples into the workspace.
Author:
El-Sharkawy
  • Field Details

  • Constructor Details

    • ExamplesInstaller

      public ExamplesInstaller(AvailableExamples.ExampleDescriptor[] selectedExamples)
      Sole constructor for this class.
      Parameters:
      selectedExamples - The list of examples, which shall be installed into workspace. Must not be null.
  • Method Details

    • installExamples

      public Set<String> installExamples() throws ExampleInstallationException
      Imports the examples into workspace.
      Returns:
      the List of successfully imported projects.
      Throws:
      ExampleInstallationException - If at least one of the examples could not be installed into the workspace.
    • unzip

      private void unzip(File zipLocation)
      Unzipps the contents of the given zip archive.
      Parameters:
      zipLocation - The location of the zip archive to unpack. Should be located inside this bundle.
      See Also:
    • addProject

      private boolean addProject(String projectName)
      Returns whether a given project name may be used for creating a new project inside the workspace.
      Parameters:
      projectName - The name of the project to be created in workspace.
      Returns:
      true if the project and the destination location do not exist, false otherwise.
    • determineProjectName

      public static String determineProjectName(String entryName)
      Calculates the project name for a given entry of a Zip archive.
      Parameters:
      entryName - The current entry for which the destination project should be calculated. Should not be null.
      Returns:
      The name of the project, may be null if destination project could not be calculated.