Created
January 19, 2015 17:20
-
-
Save akandratovich/99b5ce31485026ea0534 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 javax.inject.Named; | |
import javax.inject.Singleton; | |
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.plexus.rest.resource.AbstractPlexusResource; | |
import org.sonatype.plexus.rest.resource.PathProtectionDescriptor; | |
@Named | |
@Singleton | |
public class NexusHelloWorldResource extends AbstractPlexusResource | |
{ | |
@Override | |
public String getResourceUri() | |
{ | |
return "/hello-world"; | |
} | |
@Override | |
public PathProtectionDescriptor getResourceProtection() | |
{ | |
return new PathProtectionDescriptor(getResourceUri(), "authcBasic"); | |
} | |
@Override | |
public Object getPayloadInstance() | |
{ | |
return null; | |
} | |
@Override | |
public Object get(Context context, Request request, Response response, Variant variant) throws ResourceException | |
{ | |
return "Hello world!"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment