public static boolean sendRequest(Request request, Socket s,
			DataOutputStream out, String path, long filesize) {

		if (out == null) {
			System.err.println("No open output stream with master node.");
			return false;
		}

		switch (request) {
		case LS:
			lsRequest(s, out, path);
			break;
		case RMDIR:
			removeDir(s, out, path);
			break;
		case MKDIR:
			makeDir(s, out, path);
			break;
		case DELETE:
			deleteFile(s, out, path);
			break;
		case UPLOAD:
			uploadFile(s, out, path, filesize);
			break;
		case DOWNLOAD:
			downloadFile(s, out, path);
			break;
		}

		return true;
	}