Remove all files

This commit is contained in:
HaHaWTH
2023-09-20 02:10:19 +08:00
parent 62f27f8231
commit ed320196fe
478 changed files with 0 additions and 94591 deletions
@@ -1,47 +0,0 @@
package fr.xephi.authme.service.yaml;
import ch.jalu.configme.exception.ConfigMeException;
import ch.jalu.configme.resource.PropertyReader;
import ch.jalu.configme.resource.YamlFileResource;
import java.io.File;
/**
* Creates {@link YamlFileResource} objects.
*/
public final class YamlFileResourceProvider {
private YamlFileResourceProvider() {
}
/**
* Creates a {@link YamlFileResource} instance for the given file. Wraps SnakeYAML's parse exception
* thrown when a reader is created into an AuthMe exception.
*
* @param file the file to load
* @return the generated resource
*/
public static YamlFileResource loadFromFile(File file) {
return new AuthMeYamlFileResource(file);
}
/**
* Extension of {@link YamlFileResource} which wraps SnakeYAML's parse exception into a custom
* exception when a reader is created.
*/
private static final class AuthMeYamlFileResource extends YamlFileResource {
AuthMeYamlFileResource(File file) {
super(file);
}
@Override
public PropertyReader createReader() {
try {
return super.createReader();
} catch (ConfigMeException e) {
throw new YamlParseException(getFile().getPath(), e);
}
}
}
}
@@ -1,28 +0,0 @@
package fr.xephi.authme.service.yaml;
import ch.jalu.configme.exception.ConfigMeException;
import java.util.Optional;
/**
* Exception when a YAML file could not be parsed.
*/
public class YamlParseException extends RuntimeException {
private final String file;
/**
* Constructor.
*
* @param file the file a parsing exception occurred with
* @param configMeException the caught exception from ConfigMe
*/
public YamlParseException(String file, ConfigMeException configMeException) {
super(Optional.ofNullable(configMeException.getCause()).orElse(configMeException));
this.file = file;
}
public String getFile() {
return file;
}
}