private String getHost(String uri) throws JPlaylistParserException {
		try {
			URI host = new URI(uri);
    	
			String path;
    	
			if ((path = host.getPath()) == null || path.trim().equals("")) {
				return uri + '/';
			}
    	
			int index = path.lastIndexOf('/');
    	
			if (index > -1) {
				host = new URI(host.getScheme(), null, host.getHost(), host.getPort(), path.substring(0, index + 1), null, null);
			}
			
	    	return host.toString();
		} catch (URISyntaxException e) {
			throw new JPlaylistParserException(e.getMessage());
		}
    }