Created
October 7, 2015 04:53
-
-
Save ryankennedy/c18354ea6da0f9de803e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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