@Test public void testDelete() throws DAOException { dao.create(NEW_CHARACTER_NICK, CHARACTER_PASSWORD, CHARACTER_MAIL); final File file = new File(dao.getCharFilePath(NEW_CHARACTER_NICK)); assertTrue(file.exists()); dao.delete(NEW_CHARACTER_NICK); assertFalse(file.exists()); }
@Override public void delete(String name) { File charfile = new File(getCharFilePath(name)); if (!charfile.exists()) { return; } boolean success = charfile.delete(); if (!success) { LOGGER.error(String.format("Character (%s) deletion failed", name)); } }
UserDAOIni implements AccountDAO, UserCharacterDAO { @Override public void delete(String name) { File charfile = new File(getCharFilePath(name)); if (!charfile.exists()) { return; } boolean success = charfile.delete(); if (!success) { LOGGER.error(String.format("Character (%s) deletion failed", name)); } } }
UserDAOIni implements AccountDAO, UserCharacterDAO { @Override public void delete(String name) { File charfile = new File(getCharFilePath(name)); if (!charfile.exists()) { return; } boolean success = charfile.delete(); if (!success) { LOGGER.error(String.format("Character (%s) deletion failed", name)); } } @Inject  UserDAOIni(@Named("CharfilesPath") String charfilesPath); }
UserDAOIni implements AccountDAO, UserCharacterDAO { @Override public void delete(String name) { File charfile = new File(getCharFilePath(name)); if (!charfile.exists()) { return; } boolean success = charfile.delete(); if (!success) { LOGGER.error(String.format("Character (%s) deletion failed", name)); } } @Inject  UserDAOIni(@Named("CharfilesPath") String charfilesPath); @Override Account retrieve(String username); @Override Account create(String name, String password, String mail); @Override void delete(String name); @Override UserCharacter create(final ConnectedUser user, final String name, final Race race, final Gender gender,
			final UserArchetype archetype, final int head, final City homeland, final byte strength,
			final byte dexterity, final byte intelligence, final byte charisma, final byte constitution,
			final int initialAvailableSkills, final int body); @Override boolean exists(String name); @Override UserCharacter load(final ConnectedUser user, final String username); }
UserDAOIni implements AccountDAO, UserCharacterDAO { @Override public void delete(String name) { File charfile = new File(getCharFilePath(name)); if (!charfile.exists()) { return; } boolean success = charfile.delete(); if (!success) { LOGGER.error(String.format("Character (%s) deletion failed", name)); } } @Inject  UserDAOIni(@Named("CharfilesPath") String charfilesPath); @Override Account retrieve(String username); @Override Account create(String name, String password, String mail); @Override void delete(String name); @Override UserCharacter create(final ConnectedUser user, final String name, final Race race, final Gender gender,
			final UserArchetype archetype, final int head, final City homeland, final byte strength,
			final byte dexterity, final byte intelligence, final byte charisma, final byte constitution,
			final int initialAvailableSkills, final int body); @Override boolean exists(String name); @Override UserCharacter load(final ConnectedUser user, final String username); static final String FILE_EXTENSION; }