replace hardcoded file separator (#2121)

This commit is contained in:
steve4744 2023-04-21 11:05:00 +01:00 committed by GitHub
parent f52150ec1d
commit e991f09921
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ import com.google.common.io.Files;
*/
public abstract class Pladdon extends JavaPlugin {
private static final String ADDONS_FOLDER = "BentoBox/addons";
private static final String ADDONS_FOLDER = "BentoBox" + File.separator + "addons";
/**
* This must return a new instance of the addon. It is called when the Pladdon is loaded.
@ -33,7 +33,7 @@ public abstract class Pladdon extends JavaPlugin {
}
protected void moveJar() {
getLogger().severe(getFile().getName() + " must be in the BentoBox/addons folder! Trying to move it there...");
getLogger().severe(getFile().getName() + " must be in the " + ADDONS_FOLDER + " folder! Trying to move it there...");
File addons = new File(getFile().getParent(), ADDONS_FOLDER);
if (addons.exists() || addons.mkdirs()) {
File to = new File(addons, getFile().getName());
@ -44,7 +44,7 @@ public abstract class Pladdon extends JavaPlugin {
} catch (IOException ex) {
getLogger().severe("Failed to move it. " + ex.getMessage());
getLogger().severe("Move " + getFile().getName() + " manually into the BentoBox/addons folder. Then restart server.");
getLogger().severe("Move " + getFile().getName() + " manually into the " + ADDONS_FOLDER + " folder. Then restart server.");
}
} else {
getLogger().warning(getFile().getName() + " already is in the addons folder. Delete the one in the plugins folder.");