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

Skip to content
Snippets Groups Projects
Commit 95652f96 authored by Michael Breu's avatar Michael Breu
Browse files

Fixing PDM

parent effb0aab
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
package at.ac.uibk.gitsearch.service;
import at.ac.uibk.gitsearch.repository.gitlab.GitLabRepository;
import at.ac.uibk.gitsearch.security.jwt.TokenProvider.GitLabAccessInfo;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import java.io.IOException;
import java.io.InputStream;
import java.io.PipedInputStream;
......@@ -22,6 +12,7 @@ import java.util.UUID;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.codeability.sharing.plugins.api.ShoppingBasket;
......@@ -38,6 +29,18 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StreamUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import at.ac.uibk.gitsearch.repository.gitlab.GitLabRepository;
import at.ac.uibk.gitsearch.security.jwt.TokenProvider.GitLabAccessInfo;
/**
* Service for exercise/course search results
* <p>
......@@ -411,7 +414,9 @@ public class ShoppingBasketService {
* @return
*/
protected static boolean filterOut(String filePath, String[] filterOut, boolean isDirectory) {
if (filePath == null) return false;
if (filePath == null) {
return false;
}
for (String filter : filterOut) {
if (filter == null) {
log.warn("filter should never be null!");
......@@ -419,9 +424,14 @@ public class ShoppingBasketService {
}
IMatcher matcher;
try {
if (filter.endsWith(FastIgnoreRule.PATH_SEPARATOR + "")) matcher =
IMatcher.createPathMatcher(filter.substring(0, filter.length() - 1), true); else matcher =
if (filter.endsWith(
Character.toString(FastIgnoreRule.PATH_SEPARATOR))) {
matcher = IMatcher.createPathMatcher(
filter.substring(0, filter.length() - 1), true);
} else {
matcher =
IMatcher.createPathMatcher(filter, false);
}
} catch (InvalidPatternException e) {
log.warn("Cannot parse pattern {}", filter);
continue;
......
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