This commit is contained in:
2023-04-09 21:07:49 +02:00
parent 9330deb75f
commit 285533bb28
6 changed files with 21 additions and 19 deletions

View File

@@ -69,6 +69,10 @@ public class Config {
mkvToolNix.getAbsolutePath() + "/" + application;
}
public String getNormalizedLibraryPath() {
return this.getLibraryPath().getAbsolutePath().replace("\\", "/");
}
@Override
public String toString() {
return new StringJoiner(", ", Config.class.getSimpleName() + "[", "]")

View File

@@ -100,10 +100,16 @@ public abstract class ConfigValidator<FieldType> {
};
}
/**
* @return true if overwriting this property is necessary.
*/
protected boolean isOverwritingNecessary() {
return false;
}
/**
* @return {@link FieldType} to overwrite result with.
*/
protected FieldType overwriteValue() {
return null;
}

View File

@@ -37,7 +37,7 @@ public class DateValidator extends ConfigValidator<Date> {
return DEFAULT_DATE;
}
YAML yaml = new YAML(lastExecutionFile);
return parse(yaml.getString(Config.getInstance().getLibraryPath().getAbsolutePath().replace("\\", "/"), DateUtils.convert(DEFAULT_DATE)));
return parse(yaml.getString(Config.getInstance().getNormalizedLibraryPath(), DateUtils.convert(DEFAULT_DATE)));
} catch (YamlInvalidContentException | IOException e) {
log.error("Couldn't open last-execution.properties");
return INVALID_DATE;