@Override
	public void handle() throws Exception {
		// System.out.println("thread.path = " + thread.path);

		if (this.requestThread.path.equals("/shares/") 
				|| this.requestThread.path.equals("/shares")) {
			this.requestThread.close(302, "Fwd", "/");
			return;
		}
		
		SharedEntity sharedEntity = SharedEntity
				.requestPathToSharedEntity(this.requestThread.path);

		if ((sharedEntity == null) || !sharedEntity.isShareable()) {
			this.requestThread.close(400, "Not existing or not readable");
			return;
		}

		if (sharedEntity.isDirectory()) {
			this.handleDirlistingRequest(sharedEntity);
		} else if (sharedEntity.isFile()) {
			this.handleFileDownloadRequest(sharedEntity);
		} else {
			this.requestThread.close(403, "Woops");
			return;
		}
	}