ImportExportUtils { public static long getTopicMapId (String address) { int offset = 0; if (address.startsWith("M")) offset = 1; else if (address.startsWith(ONTOPIA_RDBMS_URI_PREFIX)) { offset = ONTOPIA_RDBMS_URI_PREFIX.length (); if (address.charAt (offset) == 'M') offset = offset + 1; } try { return Long.parseLong (address.substring (offset)); } catch (NumberFormatException e) { throw new OntopiaRuntimeException ("'" + address + " is not a valid rdbms topic map URI."); } }  @SuppressWarnings("unchecked") static Set<ImportExportServiceIF> getServices(); static TopicMapReaderIF getReader(File file); static TopicMapReaderIF getReader(String filename_or_url); static TopicMapReaderIF getReader(URL url); static TopicMapWriterIF getWriter(File tmfile); static TopicMapWriterIF getWriter(File tmfile, String encoding); static long getTopicMapId(String address);  }
@Test public void testGetTopicMapId() { testId("1", 1L); testId("123", 123L); testId("M1", 1L); testId("M123", 123L); testId("x-ontopia:tm-rdbms:1", 1L); testId("x-ontopia:tm-rdbms:123", 123L); testId("x-ontopia:tm-rdbms:M1", 1L); testId("x-ontopia:tm-rdbms:M123", 123L); }