5.0.0 #32
@ -24,10 +24,10 @@ public class ConfigI {
|
||||
return configPath.resolve(name);
|
||||
}
|
||||
|
||||
public static ConfigI load(Path configPath, String name, Class<? extends ConfigI> clazz) throws IOException, JsonSyntaxException, JsonIOException {
|
||||
public static <T extends ConfigI> T load(Path configPath, String name, Class<T> clazz) throws IOException, JsonSyntaxException, JsonIOException {
|
||||
Path path = getConfigPath(configPath, name);
|
||||
|
||||
ConfigI file;
|
||||
T file;
|
||||
|
||||
if(Files.exists(path)) {
|
||||
FileReader reader = new FileReader(path.toFile());
|
||||
@ -58,6 +58,7 @@ public class ConfigI {
|
||||
Files.writeString(this.configPath, GSON.toJson(this));
|
||||
// Files.copy(tempPath, this.configPath, StandardCopyOption.REPLACE_EXISTING);
|
||||
// Files.delete(tempPath);
|
||||
// commented because throws an error on windows each time if the file already exist
|
||||
}
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 323 KiB |
@ -8,7 +8,7 @@
|
||||
"Altarik"
|
||||
],
|
||||
"contributors": [
|
||||
"Legot Quentin<legotquentin@gmail.com>"
|
||||
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://altarik.fr"
|
||||
@ -25,5 +25,13 @@
|
||||
"fabric-api": "*",
|
||||
"minecraft": "${minecraftVersion}",
|
||||
"java": ">=17"
|
||||
},
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"badges": [ "library" ],
|
||||
"parent": {
|
||||
"parent": "toolbox"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class BuilderImpl implements IBuilder<BuilderResult> {
|
||||
|
||||
|
||||
@Override
|
||||
public BuilderResult build() throws Exception {
|
||||
public BuilderResult build() {
|
||||
return new BuilderResult(collection.get(), numberOfSentences.get());
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ public class ConfigITest {
|
||||
public double para3 = 3.14;
|
||||
|
||||
public static ConfigClazz load() throws IOException {
|
||||
return (ConfigClazz) load(Path.of("."), "test.json", ConfigClazz.class);
|
||||
return load(Path.of("."), "test.json", ConfigClazz.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,13 +25,6 @@ public abstract class AbstractSqlConnection implements SqlConnection {
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeConnection() {
|
||||
try {
|
||||
close();
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
if(!connection.isClosed()) {
|
||||
|
@ -23,10 +23,4 @@ public interface SqlConnection extends AutoCloseable {
|
||||
*/
|
||||
void checkConnection() throws SQLException;
|
||||
|
||||
/**
|
||||
* @deprecated replaced with {@link AutoCloseable#close()}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
void closeConnection();
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 323 KiB |
@ -8,7 +8,7 @@
|
||||
"Altarik"
|
||||
],
|
||||
"contributors": [
|
||||
"Legot Quentin<legotquentin@gmail.com>"
|
||||
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://altarik.fr"
|
||||
@ -26,5 +26,13 @@
|
||||
"minecraft": "${minecraftVersion}",
|
||||
"java": ">=17",
|
||||
"toolbox-core": "${version}"
|
||||
},
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"badges": [ "library" ],
|
||||
"parent": {
|
||||
"parent": "toolbox"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 323 KiB |
@ -8,7 +8,7 @@
|
||||
"Altarik"
|
||||
],
|
||||
"contributors": [
|
||||
"Legot Quentin<legotquentin@gmail.com>"
|
||||
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://altarik.fr"
|
||||
@ -29,5 +29,13 @@
|
||||
"fabric-api": "*",
|
||||
"minecraft": "${minecraftVersion}",
|
||||
"java": ">=17"
|
||||
},
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"badges": [ "library" ],
|
||||
"parent": {
|
||||
"parent": "toolbox"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 323 KiB |
@ -8,7 +8,7 @@
|
||||
"Altarik"
|
||||
],
|
||||
"contributors": [
|
||||
"Legot Quentin<legotquentin@gmail.com>"
|
||||
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://altarik.fr"
|
||||
|
@ -1 +1 @@
|
||||
okhttp_version=4.10.0
|
||||
okhttp_version=4.12.0
|
@ -8,7 +8,7 @@ loader_version=0.15.6
|
||||
fabric_version=0.95.4+1.20.4
|
||||
|
||||
maven_group=fr.altarik.toolbox
|
||||
maven_version=4.5.1
|
||||
maven_version=5.0.0
|
||||
|
||||
git_owner=quentinlegot
|
||||
git_repo=Toolbox
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 323 KiB |
@ -8,7 +8,7 @@
|
||||
"Altarik"
|
||||
],
|
||||
"contributors": [
|
||||
"Legot Quentin<legotquentin@gmail.com>"
|
||||
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://altarik.fr"
|
||||
@ -25,6 +25,11 @@
|
||||
"toolbox-database": "${version}",
|
||||
"toolbox-pagination": "${version}",
|
||||
"toolbox-task": "${version}"
|
||||
},
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"badges": [ "library" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|