Commit 6689d7a5 authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

remove unnecessary method

parent 59b4b807
...@@ -40,13 +40,6 @@ public class TaskResource ...@@ -40,13 +40,6 @@ public class TaskResource
this.tasksRepository = tasksRepository; this.tasksRepository = tasksRepository;
} }
//todo: name
private TaskResponse getTaskResponse(int taskLevel, TaskRequestContext taskRequestContext) throws IOException
{
Task task = tasksRepository.getByLevel(taskLevel);
return task.getTaskResponse(taskRequestContext);
}
private Map<String, String> extractProxiedHeaders(MultivaluedMap<String, String> headers) { private Map<String, String> extractProxiedHeaders(MultivaluedMap<String, String> headers) {
Set<String> proxiedHeaders = applicationConfiguration.getProxiedHeaders(); Set<String> proxiedHeaders = applicationConfiguration.getProxiedHeaders();
return headers.entrySet() return headers.entrySet()
...@@ -65,6 +58,7 @@ public class TaskResource ...@@ -65,6 +58,7 @@ public class TaskResource
final @PathParam("path") String path, final @PathParam("path") String path,
@Context ContainerRequestContext containerRequestContext) throws IOException @Context ContainerRequestContext containerRequestContext) throws IOException
{ {
Task task = tasksRepository.getByLevel(taskLevel);
String fullPath = path; String fullPath = path;
String query = ((ContainerRequest)containerRequestContext).getRequestUri().getQuery(); String query = ((ContainerRequest)containerRequestContext).getRequestUri().getQuery();
if(query != null) { if(query != null) {
...@@ -77,8 +71,7 @@ public class TaskResource ...@@ -77,8 +71,7 @@ public class TaskResource
.withPath(fullPath) .withPath(fullPath)
.withHeaders(headers); .withHeaders(headers);
TaskResponse taskResponse = getTaskResponse(taskLevel, taskRequestContext); TaskResponse taskResponse = task.getTaskResponse(taskRequestContext);
Response.ResponseBuilder responseBuilder = Response.ok() Response.ResponseBuilder responseBuilder = Response.ok()
.entity(taskResponse.getText()); .entity(taskResponse.getText());
...@@ -96,6 +89,7 @@ public class TaskResource ...@@ -96,6 +89,7 @@ public class TaskResource
final @PathParam("path") String path, final @PathParam("path") String path,
@Context ContainerRequestContext containerRequestContext) throws IOException @Context ContainerRequestContext containerRequestContext) throws IOException
{ {
Task task = tasksRepository.getByLevel(taskLevel);
String fullPath = path; String fullPath = path;
String query = ((ContainerRequest)containerRequestContext).getRequestUri().getQuery(); String query = ((ContainerRequest)containerRequestContext).getRequestUri().getQuery();
if(query != null) { if(query != null) {
...@@ -113,7 +107,7 @@ public class TaskResource ...@@ -113,7 +107,7 @@ public class TaskResource
.withBody(body) .withBody(body)
.withHeaders(headers); .withHeaders(headers);
TaskResponse taskResponse = getTaskResponse(taskLevel, taskRequestContext); TaskResponse taskResponse = task.getTaskResponse(taskRequestContext);
Response.ResponseBuilder responseBuilder = Response.ok() Response.ResponseBuilder responseBuilder = Response.ok()
.entity(taskResponse.getText()); .entity(taskResponse.getText());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment