class DocumentLoader {

    public Document loadFromUrl(String strUrl) throws fr.norad.visuwall.providers.common.DocumentNotLoadedException {
        Preconditions.checkNotNull(strUrl, "strUrl is mandatory");
        InputStream stream = null;
        try {
            URL url = new URL(strUrl);
            stream = url.openStream();
            DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder documentBuilder = builderFactory.newDocumentBuilder();
            return documentBuilder.parse(stream);
        } catch (MalformedURLException e) {
            throw new fr.norad.visuwall.providers.common.DocumentNotLoadedException("Can't load document from url: " + strUrl, e);
        } catch (IOException e) {
            throw new fr.norad.visuwall.providers.common.DocumentNotLoadedException("Can't load document from url: " + strUrl, e);
        } catch (SAXException e) {
            throw new fr.norad.visuwall.providers.common.DocumentNotLoadedException("Can't load document from url: " + strUrl, e);
        } catch (ParserConfigurationException e) {
            throw new fr.norad.visuwall.providers.common.DocumentNotLoadedException("Can't load document from url: " + strUrl, e);
        } finally {
            closeQuietly(stream);
        }
    }

}