Class ExamplesInstaller
java.lang.Object
net.ssehub.easy.producer.examples.ExamplesInstaller
Methods for installing selected examples into the workspace.
- Author:
- El-Sharkawy
-
Field Summary
FieldsModifier and TypeFieldDescriptionStores whether a given project may be imported into workspace (true) or already exist in workspace.private AvailableExamples.ExampleDescriptor[] -
Constructor Summary
ConstructorsConstructorDescriptionExamplesInstaller(AvailableExamples.ExampleDescriptor[] selectedExamples) Sole constructor for this class. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanaddProject(String projectName) Returns whether a given project name may be used for creating a new project inside the workspace.static StringdetermineProjectName(String entryName) Calculates the project name for a given entry of a Zip archive.Imports the examples into workspace.private voidUnzipps the contents of the given zip archive.
-
Field Details
-
projects
Stores whether a given project may be imported into workspace (true) or already exist in workspace. -
selectedExamples
-
importedProjects
-
skippedProjects
-
-
Constructor Details
-
ExamplesInstaller
Sole constructor for this class.- Parameters:
selectedExamples- The list of examples, which shall be installed into workspace. Must not be null.
-
-
Method Details
-
installExamples
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
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
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
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.
-