How to Update a Package with the Drools Guvnor REST API

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;

@WebServlet(name = "SampleGuvnorServlet", value = "/")
public final class SampleGuvnorServlet extends HttpServlet {

  protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) {
    final Client client = ClientBuilder.newClient();
    client.register(HttpAuthenticationFeature.basic("username", "password"));"http://localhost:8080/guvnor/rest/packages/samplePackage").request().put(Entity.xml("<?xml version=\"1.0\" encoding=\"UTF-8\"?><package><description>Sample Description</description><metadata><checkinComment>Sample Comment</checkinComment><title>samplePackage</title></package>")));


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s