Skip to content

Commit

Permalink
Use 'new File(parent, name)' instead of 'new File(parent + "/"+name)' (
Browse files Browse the repository at this point in the history
…NuVotifier#113)

* Change 'new File(getDataFolder() + "/...")' to use the 2 argument constructor of File instead.

* Change 'new File(folder + "/...")' to use the 2 argument constructor of File instead
  • Loading branch information
McModknower authored and Ichbinjoe committed Dec 14, 2018
1 parent 590b761 commit 98dfc34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ private void loadAndBind() {
}

// Handle configuration.
File config = new File(getDataFolder() + "/config.yml");
File rsaDirectory = new File(getDataFolder() + "/rsa");
File config = new File(getDataFolder() , "config.yml");
File rsaDirectory = new File(getDataFolder() , "rsa");
Configuration configuration;

if (!config.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ public static void save(File directory, KeyPair keyPair) throws Exception {
*/
public static KeyPair load(File directory) throws Exception {
// Read the public key file.
File publicKeyFile = new File(directory + "/public.key");
File publicKeyFile = new File(directory, "public.key");
byte[] encodedPublicKey = Files.readAllBytes(publicKeyFile.toPath());
encodedPublicKey = Base64.getDecoder().decode(new String(encodedPublicKey, StandardCharsets.UTF_8));

// Read the private key file.
File privateKeyFile = new File(directory + "/private.key");
File privateKeyFile = new File(directory, "private.key");
byte[] encodedPrivateKey = Files.readAllBytes(privateKeyFile.toPath());
encodedPrivateKey = Base64.getDecoder().decode(new String(encodedPrivateKey, StandardCharsets.UTF_8));

Expand Down

0 comments on commit 98dfc34

Please sign in to comment.