Search in sources :

Example 1 with ManagedRecipe

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();
}
Also used : ManagedRecipe(org.eclipse.che.api.machine.shared.ManagedRecipe) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 ManagedRecipe (org.eclipse.che.api.machine.shared.ManagedRecipe)1