no.tiasg.cvgen.client.resource.GeneratorResource.java Source code

Java tutorial

Introduction

Here is the source code for no.tiasg.cvgen.client.resource.GeneratorResource.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package no.tiasg.cvgen.client.resource;

import com.google.common.base.Optional;
import com.yammer.metrics.annotation.Timed;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

/**
 *
 * @author Mathias
 */
@Path("/cv")
@Produces(MediaType.APPLICATION_JSON)
public class GeneratorResource {

    public GeneratorResource() {
    }

    @GET
    @Timed
    public String getCV(@QueryParam("firstName") Optional<String> name) {
        //        return new CV();
        return "Hello " + name.or("Stranger");
    }

}