Commit 862145d5 authored by Szabolcs Gyurko's avatar Szabolcs Gyurko
Browse files

Reworked InitializeNodes class.

parent 93d4a37d
Pipeline #327 failed with stage
in 15 seconds
......@@ -49,16 +49,24 @@ import java.util.regex.Pattern;
public class InitializeNodes {
private static final Pattern PATH_PATTERN = Pattern.compile("^(/[^/]+)(/?.*)$");
private final RestOperations restOperations;
private final JeffConfiguration jeffConfiguration;
public InitializeNodes(@Qualifier("oauth2RestOperations") final OAuth2RestOperations restOperations,
final JeffConfiguration jeffConfiguration) {
this.restOperations = restOperations;
this.jeffConfiguration = jeffConfiguration;
CommandLineRunner createPagePathNodes(@Qualifier("oauth2RestOperations") final OAuth2RestOperations restOperations,
final JeffConfiguration jeffConfiguration) {
CommandLineRunner createPagePathNodes() {
return args -> {
createNodePath(jeffConfiguration, restOperations, jeffConfiguration.getPagesNodePath());
createNodePath(jeffConfiguration, restOperations, jeffConfiguration.getComponentsNodePath());
private void createNodePath(final JeffConfiguration jeffConfiguration, final RestOperations restOperations, final String path) {
private void createNodePath(final String path) {
String nodePath = path;
String pagePathElement = "";
while (PATH_PATTERN.matcher(nodePath).matches()) {
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