From ae6de5d347df3de547492f15de620b782fdc6283 Mon Sep 17 00:00:00 2001 From: Lukas Krejci Date: Wed, 5 Jun 2019 08:08:46 +0200 Subject: [PATCH] Add javadoc, remove the superfluous validation step. Signed-off-by: Lukas Krejci --- .../workspace/server/WorkspaceManager.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java index 0816086b99e8..c8e299dbeffa 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java @@ -126,6 +126,24 @@ public WorkspaceImpl createWorkspace( return workspace; } + /** + * Creates a workspace out of a devfile. + * + *

The devfile should have been validated using the + * {@link DevfileIntegrityValidator#validateDevfile(Devfile)}. This method does rest of + * the validation and actually creates the workspace. + * + * @param devfile the devfile describing the workspace + * @param namespace workspace name is unique in this namespace + * @param attributes workspace instance attributes + * @return new workspace instance + * @throws NullPointerException when either {@code config} or {@code namespace} is null + * @throws NotFoundException when account with given id was not found + * @throws ConflictException when any conflict occurs (e.g Workspace with such name already exists + * for {@code owner}) + * @throws ServerException when any other error occurs + * @throws ValidationException when incoming configuration or attributes are not valid + */ @Traced public WorkspaceImpl createWorkspace( Devfile devfile, @@ -140,7 +158,6 @@ public WorkspaceImpl createWorkspace( validator.validateAttributes(attributes); try { - devfileIntegrityValidator.validateDevfile(devfile); devfileIntegrityValidator.validateContentReferences(devfile, contentProvider); } catch (DevfileFormatException e) { throw new ValidationException(e.getMessage(), e);