/** * Loads the gazetteer lists and maps them to the nodes * * @return a map of nodes vs GazetteerLists * @param isOrdered true if the feature maps used should be ordered * @throws ResourceInstantiationException when the resource cannot be * created */ public Map<LinearNode, GazetteerList> loadLists(boolean isOrdered) throws ResourceInstantiationException { try { gazListsByNode = new HashMap<LinearNode, GazetteerList>(); Iterator<LinearNode> inodes = nodes.iterator(); while(inodes.hasNext()) { LinearNode node = inodes.next(); GazetteerList list = new GazetteerList(); list.setSeparator(separator); URL lurl = new URL(url, node.getList()); list.setURL(lurl); list.setEncoding(encoding); list.load(isOrdered); gazListsByNode.put(node, list); } // while inodes } catch(Exception ex) { throw new ResourceInstantiationException(ex); } return gazListsByNode; } // loadLists()
GazetteerList gazetteerList = (GazetteerList) object; previousURL = gazetteerList.getURL(); gazetteerList.setURL(new File(selectedFile.getParentFile(), Files.fileFromURL(gazetteerList.getURL()).getName()) .toURI().toURL()); gazetteerList.store(); gazetteerList.setURL(previousURL); gazetteerList.setModified(false);
File destination = new File(source.getParentFile(), newListFileName); gazetteerList.setURL(destination.toURI().toURL()); gazetteerList.setModified(false); } catch (MalformedURLException mue) {