net.ontopia.topicmaps.utils
Class ImportExportUtils

java.lang.Object
  extended by net.ontopia.topicmaps.utils.ImportExportUtils

public class ImportExportUtils
extends java.lang.Object

PUBLIC: Utilities for importing and exporting topic maps.

Since:
1.2

Constructor Summary
ImportExportUtils()
           
 
Method Summary
static TopicMapImporterIF getImporter(LocatorIF url)
          PUBLIC: Given a locator referring to a topic map, returns a topic map reader of the right class.
static TopicMapImporterIF getImporter(java.lang.String filename_or_url)
          PUBLIC: Given the file name or URL of a topic map, returns a topic map importer of the right class.
static TopicMapReaderIF getReader(java.io.File file)
          PUBLIC: Given a file reference to a topic map, returns a topic map reader of the right class.
static TopicMapReaderIF getReader(LocatorIF url)
          PUBLIC: Given a locator referring to a topic map, returns a topic map reader of the right class.
static TopicMapReaderIF getReader(java.util.Map properties, java.lang.String filename_or_url)
          PUBLIC: Given the topic map store properties and file name or URL of a topic map, returns a topic map reader of the right class.
static TopicMapReaderIF getReader(java.lang.String filename_or_url)
          PUBLIC: Given the file name or URL of a topic map, returns a topic map reader of the right class.
static TopicMapReaderIF getReader(java.lang.String propfile, java.lang.String filename_or_url)
          PUBLIC: Given the topic map store properties file and file name or URL of a topic map, returns a topic map reader of the right class.
static long getTopicMapId(java.lang.String address)
          INTERNAL: Gets the numeric topic map id from an RDBMS URI or a simple topic map id reference.
static TopicMapWriterIF getWriter(java.lang.String tmfile)
          PUBLIC: Given the file name of a topicmap, returns a topicmap writer of the right class.
static TopicMapWriterIF getWriter(java.lang.String tmfile, java.lang.String encoding)
          PUBLIC: Given the file name of a topicmap, returns a topicmap writer of the right class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportExportUtils

public ImportExportUtils()
Method Detail

getReader

public static TopicMapReaderIF getReader(java.lang.String propfile,
                                         java.lang.String filename_or_url)
PUBLIC: Given the topic map store properties file and 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 the suffixes '.xtm' and '.ltm' and URI schemes 'x-ontopia:tm-rdbms:'.

Since:
1.2.4

getReader

public static TopicMapReaderIF getReader(java.util.Map properties,
                                         java.lang.String filename_or_url)
PUBLIC: Given the topic map store properties and 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 the suffixes '.xtm' and '.ltm' and URI schemes 'x-ontopia:tm-rdbms:'.

Since:
1.2.4

getReader

public static TopicMapReaderIF getReader(java.io.File file)
                                  throws java.io.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:
java.io.IOException
Since:
2.0

getReader

public static TopicMapReaderIF getReader(java.lang.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(LocatorIF 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

getImporter

public static TopicMapImporterIF getImporter(java.lang.String filename_or_url)
PUBLIC: Given the file name or URL of a topic map, returns a topic map importer of the right class. Uses the file extension to determine what importer to create. Supports '.xtm', and '.ltm'.


getImporter

public static TopicMapImporterIF getImporter(LocatorIF 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(java.lang.String tmfile)
                                  throws java.io.IOException
PUBLIC: Given the file name of 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:
java.io.IOException

getWriter

public static TopicMapWriterIF getWriter(java.lang.String tmfile,
                                         java.lang.String encoding)
                                  throws java.io.IOException
PUBLIC: Given the file name of 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:
java.io.IOException

getTopicMapId

public static long getTopicMapId(java.lang.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.



Copyright © 2000-2012 Ontopia.