@Override
	public Response list() throws IOException
	{
		if(username.equals(""))
		{
			return new MessageResponse("Please log in first.");
		}
		else
		{
			synchronized(serverIdentifier)
			{
				if(serverIdentifier.isEmpty())
				{
					return new MessageResponse("No files available");
				}
				else
				{
					Set<String> files = new HashSet<String>();
					for(FileServerInfo i: serverIdentifier.values())
					{
						if(i.isOnline())
						{
							Socket socket = new Socket(i.getAddress(), i.getPort());
							ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
							oos.flush();
							ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
							ListRequest listRequest = new ListRequest(hMac.createHash("!list"));

							oos.writeObject(listRequest);
							oos.flush();
							try
							{
								Response response = (Response) ois.readObject();
								if(response instanceof ListResponse)
								{
									ListResponse listResponse = (ListResponse)response;
									if(!hMac.verifyHash(listResponse.gethMac(), listResponse.toString()))
									{
										System.out.println("This message has been tampered with: " + listResponse.toString());
									}
									oos.close();
									ois.close();
									socket.close();
									files.addAll(listResponse.getFileNames());
								}
								if(response instanceof MessageResponse)
								{
									if(((MessageResponse)response).getMessage().equals("!again"))
									{
										return list();
									}
								}
							} 
							catch (ClassNotFoundException e)
							{
								e.printStackTrace();
							}
						}
					}
					return new ListResponse("", files);
				}
			}
		}
	}