This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects

Resolve "Die Statistiken sollten auch in ElasticSearch hinterlegt werden."

Compare and Show latest version
2 files
+ 69
17
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -28,6 +28,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.PostConstruct;
import javax.el.MethodNotFoundException;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.codeability.sharing.plugins.api.search.UserProvidedMetadataDTO;
import org.gitlab4j.api.GitLabApi;
@@ -306,22 +307,25 @@ public class GitlabEventService {
}
return this.getPath().getParent().resolve(childPath).normalize();
}
}
public String[] parseChildPath(String childPath) throws ParseException {
Pattern pattern = Pattern.compile("^(http[^\\[]+)?(\\[(\\d*)\\])?(.+)?$");
Matcher match = pattern.matcher(childPath);
if (!match.find()) {
throw new ParseException("Cannot parse " + childPath, 0);
}
String childGitUrl = match.group(1);
String childProjectId = match.group(3);
String childPathString = match.group(4);
if (childProjectId != null && childPathString.startsWith("/")) {
// we transfer it into a relative path
childPathString = childPathString.substring(1);
}
return new String[] { childGitUrl, childProjectId, childPathString };
protected static String[] parseChildPath(String childPath) throws ParseException {
Pattern pattern = Pattern.compile("^(http[^\\[]+)?(\\[(\\d*)\\])?(.+)?$");
Matcher match = pattern.matcher(childPath);
if (!match.find()) {
throw new ParseException("Cannot parse " + childPath, 0);
}
String childGitUrl = match.group(1);
String childProjectId = match.group(3);
if (StringUtils.isEmpty(childProjectId)) {
childProjectId = null;
}
String childPathString = match.group(4);
if (childProjectId != null && childPathString != null && childPathString.startsWith("/")) {
// we transfer it into a relative path
childPathString = childPathString.substring(1);
}
return new String[] { childGitUrl, childProjectId, childPathString };
}
/**