Toggle navigation
Home
java.lang.String to org.eclipse.che.api.workspace.shared.dto.WorkspaceConfigDto
No. of Instances - 1
No. of Commits - 1
No. of Projects - {'che'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Jdk -> Internal
Mapping:
Add or Remove Method invocation
CompletableFuture.runAsync(() -> { URL resource=TestWorkspaceImpl.class.getResource("/templates/workspace/" + template); if (resource == null) { throw new IllegalStateException(format("Workspace template '%s' not found",template)); } try { final Workspace ws=workspaceServiceClient.createWorkspace(name,memoryInGB,GB,resource.getPath()); workspaceServiceClient.start(id.updateAndGet((s) -> ws.getId()),name,owner); LOG.info("Workspace name='{}' id='{}' has been created.",name,ws.getId()); } catch ( Exception e) { String errorMessage=format("Workspace name='%s' start failed.",name); LOG.error(errorMessage,e); try { workspaceServiceClient.delete(name,owner.getName()); } catch ( Exception e1) { throw new IllegalStateException(format("Failed to remove workspace name='%s' when start is failed.",name),e); } throw new IllegalStateException(errorMessage,e); } } )
to
CompletableFuture.runAsync(() -> { if (template == null) { throw new IllegalStateException("Workspace template cannot be null"); } try { final Workspace ws=workspaceServiceClient.createWorkspace(name,memoryInGB,GB,template); workspaceServiceClient.start(id.updateAndGet((s) -> ws.getId()),name,owner); LOG.info("Workspace name='{}' id='{}' has been created.",name,ws.getId()); } catch ( Exception e) { String errorMessage=format("Workspace name='%s' start failed.",name); LOG.error(errorMessage,e); try { workspaceServiceClient.delete(name,owner.getName()); } catch ( Exception e1) { throw new IllegalStateException(format("Failed to remove workspace name='%s' when start is failed.",name),e); } throw new IllegalStateException(errorMessage,e); } } )