public void renameFolder(FolderDTO folderDTO, String folderNewName) throws DataProcessingException {
		if (folderDTO.getFolderName().equals("Inbox")
				|| folderDTO.getFolderName().equals("Outbox")
				|| folderDTO.getFolderName().equals("Draft")) {
			throw new DataProcessingException(ExceptionType.systemFolderRenaming);
		}

		Folder folder = folderDAO.getFolder(folderDTO.getId());

		if (folder == null) {
			logger.warn("Folder does not exist");
			throw new DataProcessingException(ExceptionType.folderDoesNotExist);
		}

		folder.setFolderName(folderNewName);

		try {
			folderDAO.flush();
		} catch (EJBException e) {
			logger.warn("Folder with name " + folderDTO.getFolderName() + " already exists");
			throw new DataProcessingException(ExceptionType.folderWithSuchANameAlreadyExists);
		}

		logger.info("Folder successfully renamed");
	}