class HeatStackAudit {

    protected Optional<String> extractStackPathFromHref(String href) {
        try {
            URI uri = new URI(href);
            Pattern p = Pattern.compile("/stacks.*");
            Matcher m = p.matcher(uri.getPath());
            if (m.find()) {
                return Optional.of(m.group());
            } else
                return Optional.empty();
        } catch (Exception e) {
            logger.error("Error parsing URI", e);
        }
        return Optional.empty();
    }

}