package de.retest.recheck.ignore;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;

import de.retest.recheck.configuration.ProjectConfiguration;
import de.retest.recheck.configuration.ProjectConfigurationUtil;

public class RecheckIgnoreUtil {

	private RecheckIgnoreUtil() {

	}

	public static Optional<Path> getIgnoreFile() {
		final String projectBasePath = System.getProperty( ProjectConfiguration.RETEST_PROJECT_ROOT, "" );
		final Path projectConfig = ProjectConfigurationUtil.findProjectConfigurationFolder(
				Paths.get( projectBasePath ) );
		final Path ignoreFile = projectConfig.resolve( ProjectConfiguration.RECHECK_IGNORE );

		if ( ignoreFile.toFile().exists() ) {
			return Optional.of( ignoreFile );
		}

		return Optional.empty();
	}
}

@@ -453,24 +453,63 @@
 ROOT, %22%22 );%0A
+%09%09if ( !projectBasePath.isEmpty() ) %7B%0A%09
 %09%09final Path
@@ -582,16 +582,17 @@
 Folder(%0A
+%09
 %09%09%09%09Path
@@ -621,16 +621,17 @@
  ) );%0A%09%09
+%09
 final Pa
@@ -708,17 +708,250 @@
 NORE );%0A
-%0A
+%09%09%09if ( ignoreFile.toFile().exists() ) %7B%0A%09%09%09%09return Optional.of( ignoreFile );%0A%09%09%09%7D%0A%09%09%7D else %7B%0A%09%09%09final Path ignoreFile = ProjectConfigurationUtil.findProjectConfigurationFolder().resolve(%0A%09%09%09%09%09ProjectConfiguration.RECHECK_IGNORE );%0A%09
 %09%09if ( i
@@ -982,16 +982,17 @@
 s() ) %7B%0A
+%09
 %09%09%09retur
@@ -1022,18 +1022,22 @@
 le );%0A%09%09
+%09
 %7D%0A
+%09%09%7D
 %0A%09%09retur

Fix recheck.ignore finder