public void delete(final String userName) throws DataNotFoundException, DataAccessFailException {
		if(!cache.containsValue(userName)) {
			throw new DataNotFoundException("User with username "+userName+" not exist in file!\n");
		}
		
		final File dataSource = new File(filePath);
		if(!dataSource.exists()) {
			throw new DataAccessFailException("File is not found");
		}
		BufferedReader reader = null;
		BufferedWriter writer = null;
		File temporary = null;
		try {
			HashMap<String, String> tempCache = new HashMap<String, String>();
			temporary = File.createTempFile("temporary", ".txt");
			reader = new BufferedReader(new FileReader(dataSource));
			writer = new BufferedWriter(new FileWriter(temporary));
			String line;
			while((line = reader.readLine()) != null) {  // NOPMD tomascejka tocecz on 26.4.13 14:55
				final String[] items = line.split(REGEX_SPLIT,3);
				if(!items[1].equals(userName)) 
				{
					writer.write(line);
					writer.newLine();
					tempCache.put(items[0], items[1]);
				}
			}
			//safety invalidation of cache
			cache = tempCache;
			Path remote = dataSource.toPath();
			if(temporary != null) 
			{
				Files.delete(remote);
				Path finalPath = Files.move(temporary.toPath(),remote);
				System.out.println("Renamed: "+finalPath == null ? "N/A" : finalPath);
			}
			
		} catch (FileNotFoundException e) {
			throw new ConsoleException(FILE_FOUND_FAIL, e);
		} catch (IOException e) {
			throw new ConsoleException(READ_FAIL, e);
		} finally {
			Tool.close(reader, writer);			
		}
	}