Skip to content

Instantly share code, notes, and snippets.

@ryankennedy
Created October 7, 2015 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryankennedy/c18354ea6da0f9de803e to your computer and use it in GitHub Desktop.
Save ryankennedy/c18354ea6da0f9de803e to your computer and use it in GitHub Desktop.
import io.dropwizard.Application;
import io.dropwizard.setup.Environment;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import java.util.UUID;
public class TestUuidApplication extends Application<TestUuidConfiguration> {
public static void main(String[] args) throws Exception {
new TestUuidApplication().run(args);
}
@Override
public void run(TestUuidConfiguration configuration, Environment environment) throws Exception {
environment.jersey().register(new UuidParameterResource());
}
@Path("/uuids")
public class UuidParameterResource {
@GET
public String getAllIds(@HeaderParam("UserUUID") UUID uuid) {
return "Here are all UUIDs visible for user " + uuid.toString() + "\n";
}
@GET
@Path("/{uuid}")
public String getId(@PathParam("uuid") UUID uuid) {
return "uuid = " + uuid.toString();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment