Commit 9bef56cd authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

fix url joiner

parent 35e9115f
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
public class WebTask extends Task public class WebTask extends Task
{ {
private String url; private String url;
private final Joiner urlJoiner = Joiner.on("/"); private static final Joiner URL_JOINER = Joiner.on("/");
public WebTask(String name, int level, List<Flag> flags, String url) public WebTask(String name, int level, List<Flag> flags, String url)
{ {
...@@ -35,7 +35,7 @@ public class WebTask extends Task ...@@ -35,7 +35,7 @@ public class WebTask extends Task
public String getTextForUser(User user, String path) throws IOException public String getTextForUser(User user, String path) throws IOException
{ {
String url = urlJoiner.join(getUrl(), path); String url = URL_JOINER.join(getUrl(), path);
return StreamUtils.readStream(proxyRequest(url, user)); return StreamUtils.readStream(proxyRequest(url, user));
} }
......
...@@ -70,7 +70,7 @@ public class SolutionsResource ...@@ -70,7 +70,7 @@ public class SolutionsResource
.stream() .stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
Team::getName, Team::getName,
team -> solutionsRepository.getCompletedTasks(team) solutionsRepository::getCompletedTasks
)); ));
} }
...@@ -82,7 +82,7 @@ public class SolutionsResource ...@@ -82,7 +82,7 @@ public class SolutionsResource
.stream() .stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
Team::getName, Team::getName,
team -> solutionsRepository.getTeamSolutions(team) solutionsRepository::getTeamSolutions
)); ));
} }
......
package com.telephoners.krakyournet.ctf.resources; package com.telephoners.krakyournet.ctf.resources;
import com.google.common.base.Joiner;
import com.telephoners.krakyournet.ctf.beans.User; import com.telephoners.krakyournet.ctf.beans.User;
import com.telephoners.krakyournet.ctf.beans.tasks.Task; import com.telephoners.krakyournet.ctf.beans.tasks.Task;
import com.telephoners.krakyournet.ctf.repositories.TasksRepository; import com.telephoners.krakyournet.ctf.repositories.TasksRepository;
......
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