forked from GeyserMC/Geyser
Use Path instead of File for floodgate key file in config
...and fix related issues with the file not being found.
This commit is contained in:
parent
c4857c6a54
commit
240f41ff03
6 changed files with 21 additions and 13 deletions
|
@ -29,6 +29,8 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||
import org.geysermc.common.IGeyserConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -100,8 +102,8 @@ public class GeyserBukkitConfiguration implements IGeyserConfiguration {
|
|||
}
|
||||
|
||||
@Override
|
||||
public File getFloodgateKeyFile() {
|
||||
return new File(dataFolder.toString() + config.getString("floodgate-key-file", "public-key.pem"));
|
||||
public Path getFloodgateKeyFile() {
|
||||
return Paths.get(dataFolder.toString(), config.getString("floodgate-key-file", "public-key.pem"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,6 +30,8 @@ import net.md_5.bungee.config.Configuration;
|
|||
import org.geysermc.common.IGeyserConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -101,8 +103,8 @@ public class GeyserBungeeConfiguration implements IGeyserConfiguration {
|
|||
}
|
||||
|
||||
@Override
|
||||
public File getFloodgateKeyFile() {
|
||||
return new File(dataFolder, config.getString("floodgate-key-file", "public-key.pem"));
|
||||
public Path getFloodgateKeyFile() {
|
||||
return Paths.get(dataFolder.toString(), config.getString("floodgate-key-file", "public-key.pem"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,6 +32,8 @@ import ninja.leaping.configurate.ConfigurationNode;
|
|||
import org.geysermc.common.IGeyserConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -104,8 +106,8 @@ public class GeyserSpongeConfiguration implements IGeyserConfiguration {
|
|||
}
|
||||
|
||||
@Override
|
||||
public File getFloodgateKeyFile() {
|
||||
return new File(dataFolder, node.getNode("floodgate-key-file").getString("public-key.pem"));
|
||||
public Path getFloodgateKeyFile() {
|
||||
return Paths.get(dataFolder.toString(), node.getNode("floodgate-key-file").getString("public-key.pem"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,10 +27,13 @@ package org.geysermc.platform.standalone;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import org.geysermc.common.IGeyserConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Map;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
|
@ -63,8 +66,8 @@ public class GeyserConfiguration implements IGeyserConfiguration {
|
|||
private MetricsInfo metrics;
|
||||
|
||||
@Override
|
||||
public File getFloodgateKeyFile() {
|
||||
return new File(floodgateKeyFile);
|
||||
public Path getFloodgateKeyFile() {
|
||||
return Paths.get(floodgateKeyFile);
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue