/** * Returns content of recipe either by getting it from provided {@link Recipe} object or by * retrieving it from location set in provided recipe. * * @param recipe recipe of {@link org.eclipse.che.api.core.model.workspace.config.Environment} * @return recipe content * @throws NullPointerException when recipe is null * @throws IllegalArgumentException when both recipe content and location are null or empty */ public InternalRecipe getRecipe(Recipe recipe) throws InfrastructureException { Objects.requireNonNull(recipe, "Recipe should not be null"); Objects.requireNonNull(recipe.getType(), "Recipe type should not be null"); return new InternalRecipe(recipe.getType(), recipe.getContentType(), retrieveContent(recipe)); }