/* * Iterate over the sites in the given configuration and remove the one which * has a url matching the given location. */ public boolean removeSite(Configuration configuration, String location) throws IOException, URISyntaxException { File left = new File(new URI(location)).getCanonicalFile(); List sites = configuration.getSites(); for (Iterator iter = sites.iterator(); iter.hasNext(); ) { Site tempSite = (Site) iter.next(); String siteURL = tempSite.getUrl(); File right = new File(new URI(siteURL)).getCanonicalFile(); if (left.equals(right)) { return configuration.removeSite(tempSite); } } return false; }