Created
July 30, 2014 18:10
-
-
Save KAllan357/6c170e37a97c3b310a77 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
package com.riotgames.nexus.rest; | |
import org.restlet.Context; | |
import org.restlet.data.Request; | |
import org.restlet.data.Response; | |
import org.restlet.resource.ResourceException; | |
import org.restlet.resource.Variant; | |
import org.sonatype.nexus.rest.AbstractNexusPlexusResource; | |
import org.sonatype.plexus.rest.resource.AbstractPlexusResource; | |
import org.sonatype.plexus.rest.resource.PathProtectionDescriptor; | |
import org.sonatype.plexus.rest.resource.PlexusResource; | |
import javax.inject.Named; | |
import javax.inject.Singleton; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
@Named | |
@Singleton | |
@Path("/hello") | |
@Produces("application/json") | |
public class HelloWorld extends AbstractNexusPlexusResource { | |
@Override | |
public String getResourceUri() { | |
return "/hello"; | |
} | |
@Override | |
public PathProtectionDescriptor getResourceProtection() { | |
return new PathProtectionDescriptor( this.getResourceUri(), "anon" ); | |
} | |
@Override | |
public Object getPayloadInstance() { | |
return null; | |
} | |
@Override | |
@GET | |
public Object get(Context context, Request request, Response response, Variant variant) throws ResourceException { | |
return "Hey buddy!"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment