Class ImportExportUtils


  • public class ImportExportUtils
    extends Object
    PUBLIC: Utilities for importing and exporting topic maps.
    Since:
    1.2
    • Constructor Detail

      • ImportExportUtils

        public ImportExportUtils()
    • Method Detail

      • getServices

        public static Set<ImportExportServiceIF> getServices()
        Returns the loaded ImportExportServiceIF services.
        Returns:
        the loaded ImportExportServiceIF services.
        Since:
        5.4.0
      • getReader

        public static TopicMapReaderIF getReader​(File file)
                                          throws IOException
        PUBLIC: Given a file reference to a topic map, returns a topic map reader of the right class. Uses the file extension to determine what reader to create. Supports '.xtm', and '.ltm'.
        Throws:
        IOException
        Since:
        2.0
      • getReader

        public static TopicMapReaderIF getReader​(String filename_or_url)
        PUBLIC: Given the file name or URL of a topic map, returns a topic map reader of the right class. Uses the file extension to determine what reader to create. Supports '.xtm', and '.ltm'.
      • getReader

        public static TopicMapReaderIF getReader​(URL url)
        PUBLIC: Given a locator referring to a topic map, returns a topic map reader of the right class. Uses the file extension to determine what reader to create. Supports '.xtm', '.tmx', and '.ltm'.
        Since:
        2.0
      • getWriter

        public static TopicMapWriterIF getWriter​(File tmfile)
                                          throws IOException
        PUBLIC: Given the file for a topicmap, returns a topicmap writer of the right class. Uses the file extension to determine what writer to create. Supports '.xtm' and '.tmx'. If the suffix is unknown, the default writer is a XTM writer.
        Throws:
        IOException
      • getWriter

        public static TopicMapWriterIF getWriter​(File tmfile,
                                                 String encoding)
                                          throws IOException
        PUBLIC: Given the file for a topicmap, returns a topicmap writer of the right class. Uses the file extension to determine what writer to create. Supports '.xtm' and '.tmx'. If the suffix is unknown, the default writer is a XTM writer.
        Throws:
        IOException
      • getTopicMapId

        public static long getTopicMapId​(String address)
        INTERNAL: Gets the numeric topic map id from an RDBMS URI or a simple topic map id reference. Examples: x-ontopia:tm-rdbms:123, x-ontopia:tm-rdbms:M123, 123 and M123.