public void readAndExecute(InputStream in) {
		BufferedReader reader = null;
		String line = null;
		try {
			reader = new BufferedReader(new InputStreamReader(in, Charset.defaultCharset()));
			while (true) {
				LOGGER.debug("Reading console input...");

				LOG.debug(Constants.PROMPT);
				line = reader.readLine();

				LOGGER.debug("Received command [ " + line + " ]");

				String result = execute(line);

				if (result == null) {
					break;
				}

				LOGGER.debug("Print out the result of the command processing");

				LOG.debug(result);
			}
		} catch (IOException e) {
			LOGGER.error("Error occurred when trying to read the console input : " + e.getLocalizedMessage(), e);

			LOG.debug(propertiesLoader.loadProperty(Constants.MAIN_APPLICATION_ERROR));
		} finally {
			if (reader != null) {
				try {
					reader.close();
				} catch (IOException e) {
					LOGGER.error("Error occurred when trying to close the input reader : " + e.getLocalizedMessage(), e);
				}
			}
		}
	}