Config Resources: Gets rid of unnecessary UriInfo param

This commit is contained in:
Johannes Schnatterer
2018-08-02 13:18:21 +02:00
parent 54354590ac
commit 982d502203
4 changed files with 5 additions and 13 deletions

View File

@@ -14,9 +14,7 @@ import javax.ws.rs.GET;
import javax.ws.rs.PUT; import javax.ws.rs.PUT;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
/** /**
* RESTful Web Service Resource to manage the configuration of the git plugin. * RESTful Web Service Resource to manage the configuration of the git plugin.
@@ -79,7 +77,7 @@ public class GitConfigResource {
@ResponseCode(code = 500, condition = "internal server error") @ResponseCode(code = 500, condition = "internal server error")
}) })
@TypeHint(TypeHint.NO_CONTENT.class) @TypeHint(TypeHint.NO_CONTENT.class)
public Response update(@Context UriInfo uriInfo, GitConfigDto configDto) { public Response update(GitConfigDto configDto) {
GitConfig config = dtoToConfigMapper.map(configDto); GitConfig config = dtoToConfigMapper.map(configDto);

View File

@@ -14,9 +14,7 @@ import javax.ws.rs.GET;
import javax.ws.rs.PUT; import javax.ws.rs.PUT;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
/** /**
* RESTful Web Service Resource to manage the configuration of the hg plugin. * RESTful Web Service Resource to manage the configuration of the hg plugin.
@@ -79,7 +77,7 @@ public class HgConfigResource {
@ResponseCode(code = 500, condition = "internal server error") @ResponseCode(code = 500, condition = "internal server error")
}) })
@TypeHint(TypeHint.NO_CONTENT.class) @TypeHint(TypeHint.NO_CONTENT.class)
public Response update(@Context UriInfo uriInfo, HgConfigDto configDto) { public Response update(HgConfigDto configDto) {
HgConfig config = dtoToConfigMapper.map(configDto); HgConfig config = dtoToConfigMapper.map(configDto);
@@ -91,8 +89,8 @@ public class HgConfigResource {
return Response.noContent().build(); return Response.noContent().build();
} }
// TODO // TODO
//* `auto-configuration`
// * `packages` // * `packages`
// * `packages/{pkgId}` // * `packages/{pkgId}`
// * `installations/hg` // * `installations/hg`

View File

@@ -14,9 +14,7 @@ import javax.ws.rs.GET;
import javax.ws.rs.PUT; import javax.ws.rs.PUT;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
/** /**
* RESTful Web Service Resource to manage the configuration of the svn plugin. * RESTful Web Service Resource to manage the configuration of the svn plugin.
@@ -79,7 +77,7 @@ public class SvnConfigResource {
@ResponseCode(code = 500, condition = "internal server error") @ResponseCode(code = 500, condition = "internal server error")
}) })
@TypeHint(TypeHint.NO_CONTENT.class) @TypeHint(TypeHint.NO_CONTENT.class)
public Response update(@Context UriInfo uriInfo, SvnConfigDto configDto) { public Response update(SvnConfigDto configDto) {
SvnConfig config = dtoToConfigMapper.map(configDto); SvnConfig config = dtoToConfigMapper.map(configDto);

View File

@@ -14,9 +14,7 @@ import javax.ws.rs.GET;
import javax.ws.rs.PUT; import javax.ws.rs.PUT;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
@Path(ConfigResource.CONFIG_PATH_V2) @Path(ConfigResource.CONFIG_PATH_V2)
public class ConfigResource { public class ConfigResource {
@@ -70,7 +68,7 @@ public class ConfigResource {
@ResponseCode(code = 500, condition = "internal server error") @ResponseCode(code = 500, condition = "internal server error")
}) })
@TypeHint(TypeHint.NO_CONTENT.class) @TypeHint(TypeHint.NO_CONTENT.class)
public Response update(ConfigDto configDto, @Context UriInfo uriInfo) { public Response update(ConfigDto configDto) {
// This *could* be moved to ScmConfiguration or ScmConfigurationUtil classes. // This *could* be moved to ScmConfiguration or ScmConfigurationUtil classes.
// But to where to check? load() or store()? Leave it for now, SCMv1 legacy that can be cleaned up later. // But to where to check? load() or store()? Leave it for now, SCMv1 legacy that can be cleaned up later.