ru.vyukov.anotherliverefresh.autoconfigure.AnotherLiveRefreshProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of another-live-refresh-spring-boot-starter Show documentation
Show all versions of another-live-refresh-spring-boot-starter Show documentation
alternative for livereload.com for spring boot projects
package ru.vyukov.anotherliverefresh.autoconfigure;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.AntPathMatcher;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
@ConfigurationProperties("liverefresh")
public class AnotherLiveRefreshProperties {
private final AntPathMatcher antPathMatcher = new AntPathMatcher();
/**
* Active Live Refresh on true
*/
@Setter
@Getter
private boolean enable;
/**
* default:
*
*
* ignore-file-changes:
* - "/**/application.properties"
* - "/**/application.yml"
* - "/**/git.properties"
*
*/
@NonNull
@Getter
@Setter
private List ignoreFileChanges = Arrays.asList("/**/application.properties", "/**/application.yml",
"/**/git.properties");
public boolean isIgnorePath(Path path) {
for (String pattern : ignoreFileChanges) {
if (antPathMatcher.match(pattern, path.toString())) {
return true;
}
}
return false;
}
}