public void completed(final HttpResponse response) {
		LOGGER.info(response.getStatusLine() + " -> [" + httpHost.getHostName()
				+ "] " + request.getRequestLine().getMethod() + " "
				+ request.getRequestLine().getUri());

		File directory = new File(CRAWLED_HOSTS_PATH + "/"
				+ httpHost.getHostName());
		if (!directory.isDirectory()) {
			directory.mkdir();
		}

		// create md5 hashes for both host and path
		byte[] pathKeyDigest = CommonUtil.getMD5EncodedDigest(request
				.getRequestLine().getUri());
		OutputStream os = null;
		InputStream is = null;
		try {
			String fileName = new String(pathKeyDigest,
					Charset.forName("UTF-8"));
			File responseFile = new File(directory.getAbsolutePath() + "/"
					+ fileName);

			if (responseFile.createNewFile()) {
				byte[] iobuf = new byte[1024];
				is = response.getEntity().getContent();
				BufferedInputStream bis = new BufferedInputStream(is);
				os = new FileOutputStream(responseFile);
				int byteCount = 0;
				while ((byteCount = bis.read(iobuf)) != -1) {
					os.write(iobuf, 0, byteCount);
				}
				os.flush();
				os.close();
				is.close();


			}
			// inform crawler
			sendMessageToCrawler("SUCCESS:" + request.getRequestLine().getUri() + ":" + responseFile.getAbsolutePath());
			LOGGER.info(responseFile.getAbsolutePath() + " saved");
		} catch (IllegalStateException e) {
			LOGGER.error(e.getMessage());
		} catch (FileNotFoundException e) {
			LOGGER.error(e.getMessage());
		} catch (IOException e) {
			LOGGER.error(e.getMessage());
		} finally {
			if (os != null) {
				try {
					os.close();
					is.close();
				} catch (IOException e) {
					LOGGER.error(e.getMessage());
				}

			}
		}
	}