package de.retest.recheck.ignore;

import static de.retest.recheck.configuration.ProjectConfiguration.FILTER_FOLDER;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import de.retest.recheck.configuration.ProjectConfiguration;

public class SearchFilterFiles {

	public static final String FILES_ENDING = ".filter";
	private static final String BASIC_FILTER_DIR = "/filter/";
	private static final String WEB_FILTER_DIR = BASIC_FILTER_DIR + "web/";
	private static final List<String> defaultWebFilter =
			Arrays.asList( WEB_FILTER_DIR + "positioning.filter", WEB_FILTER_DIR + "visibility.filter" );

	private SearchFilterFiles() {}

	private static Path resolveFilterPath() {
		return ProjectConfiguration.getInstance().findProjectConfigFolder().resolve( FILTER_FOLDER );
	}

	public static List<File> getDefaultFilterFiles() {
		return defaultWebFilter.stream() //
				.map( filter -> SearchFilterFiles.class.getResource( filter ) ) //
				.filter( Objects::nonNull ) //
				.map( resource -> new File( resource.getFile() ) ) //
				.collect( Collectors.toList() ); //
	}

	public static List<Path> getProjectFilterFiles() throws IOException {
		if ( !resolveFilterPath().toFile().exists() ) {
			return Collections.emptyList();
		}
		try ( Stream<Path> paths = Files.walk( resolveFilterPath() ) ) {
			return paths.filter( Files::isRegularFile ) //
					.filter( file -> file.toString().endsWith( FILES_ENDING ) ) //
					.collect( Collectors.toList() ); //
		}
	}
}

@@ -860,151 +860,8 @@
 %7B%7D%0A%0A
-%09private static Path resolveFilterPath() %7B%0A%09%09return ProjectConfiguration.getInstance().findProjectConfigFolder().resolve( FILTER_FOLDER );%0A%09%7D%0A%0A
 %09pub
@@ -1225,16 +1225,140 @@
 ption %7B%0A
+%09%09final Path resolveFilterPath =%0A%09%09%09%09ProjectConfiguration.getInstance().findProjectConfigFolder().resolve( FILTER_FOLDER );%0A
 %09%09if ( !
@@ -1374,18 +1374,16 @@
 lterPath
-()
 .toFile(
@@ -1494,18 +1494,16 @@
 lterPath
-()
  ) ) %7B%0A%09

Change method to a variable