From 888230b76890ae23330c29c14fe8aaf13b6bbbc8 Mon Sep 17 00:00:00 2001 From: Major- Date: Fri, 28 Aug 2015 18:25:58 +0100 Subject: [PATCH] Remove unused BinaryFileUtils class. --- .../game/io/player/BinaryFileUtils.java | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 game/src/main/org/apollo/game/io/player/BinaryFileUtils.java diff --git a/game/src/main/org/apollo/game/io/player/BinaryFileUtils.java b/game/src/main/org/apollo/game/io/player/BinaryFileUtils.java deleted file mode 100644 index dc2e468d..00000000 --- a/game/src/main/org/apollo/game/io/player/BinaryFileUtils.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.apollo.game.io.player; - -import java.io.File; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.apollo.util.NameUtil; - -/** - * A utility class with common functionality used by the binary player loader/ savers. - * - * @author Graham - * @author Major - */ -public final class BinaryFileUtils { - - /** - * The Path to the saved games directory. - */ - private static final Path SAVED_GAMES_DIRECTORY = Paths.get("data/savedGames"); - - /** - * Creates the saved games directory if it does not exist. - */ - static { - try { - if (!Files.exists(SAVED_GAMES_DIRECTORY)) { - Files.createDirectory(SAVED_GAMES_DIRECTORY); - } - } catch (IOException e) { - throw new UncheckedIOException("Error creating saved games directory.", e); - } - } - - /** - * Gets the save {@link File} for the specified player. - * - * @param username The username of the player. - * @return The file. - */ - public static Path getFile(String username) { - String filtered = NameUtil.decodeBase37(NameUtil.encodeBase37(username)); - return SAVED_GAMES_DIRECTORY.resolve(filtered + ".dat"); - } - - /** - * Sole private constructor to prevent instantiation. - */ - private BinaryFileUtils() { - - } - -} \ No newline at end of file