Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
CTF
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grzegorz
CTF
Commits
6689d7a5
Commit
6689d7a5
authored
Apr 10, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary method
parent
59b4b807
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
TaskResource.java
...m/telephoners/krakyournet/ctf/resources/TaskResource.java
+4
-10
No files found.
service/src/main/java/com/telephoners/krakyournet/ctf/resources/TaskResource.java
View file @
6689d7a5
...
@@ -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
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment