LocalMirrorIRIMapper implements OWLOntologyIRIMapper { static Map<IRI, IRI> parseDirectoryMappingFile(InputStream inputStream, final File parentFolder) throws IOException { if (inputStream == null) { throw new IllegalArgumentException("InputStream should never be null, missing resource?"); } try { final Map<IRI, IRI> mappings = new HashMap<IRI, IRI>(); for (String line : IOUtils.readLines(inputStream)) { if (line.startsWith("#")) { continue; } String[] toks = line.split(" ", 2); if (toks.length != 2) { throw new IOException("Each line must have 1 space: "+line); } mappings.put(IRI.create(toks[0]), IRI.create(toks[1])); } return mappings; } finally { inputStream.close(); } } LocalMirrorIRIMapper(Map<IRI, IRI> mappings);  LocalMirrorIRIMapper(String mappingFile);  LocalMirrorIRIMapper(File mappingFile);  LocalMirrorIRIMapper(File mappingFile, File parentFolder);  LocalMirrorIRIMapper(URL mappingURL);  LocalMirrorIRIMapper(URL mappingURL, File parentFolder); @Override IRI getDocumentIRI(IRI ontologyIRI);  }
@Test public void testParseCatalogXML() throws Exception { File resource = getResource("owl-mirror.txt"); InputStream inputStream = new FileInputStream(resource); File parentFolder = resource.getParentFile(); Map<IRI, IRI> mappings = LocalMirrorIRIMapper.parseDirectoryMappingFile(inputStream, parentFolder); assertTrue(mappings.size() == 2); }