use of org.eclipse.che.api.machine.shared.ManagedRecipe in project che by eclipse.
the class RecipeService method getRecipeScript.
@GET
@Path("/{id}/script")
public Response getRecipeScript(@PathParam("id") String id) throws ApiException, UnsupportedEncodingException {
// Do not remove!
// Docker can not use dockerfile in some cases without content-length header.
final ManagedRecipe recipe = recipeDao.getById(id);
byte[] script = recipe.getScript().getBytes("UTF-8");
return Response.ok(script, MediaType.TEXT_PLAIN).header(HttpHeaders.CONTENT_LENGTH, script.length).build();
}
Aggregations