Package net.ontopia.topicmaps.utils
Class ImportExportUtils
- java.lang.Object
-
- net.ontopia.topicmaps.utils.ImportExportUtils
-
public class ImportExportUtils extends Object
PUBLIC: Utilities for importing and exporting topic maps.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description ImportExportUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TopicMapReaderIF
getReader(File file)
PUBLIC: Given a file reference to a topic map, returns a topic map reader of the right class.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.static TopicMapReaderIF
getReader(URL url)
PUBLIC: Given a locator referring to a topic map, returns a topic map reader of the right class.static Set<ImportExportServiceIF>
getServices()
Returns the loaded ImportExportServiceIF services.static long
getTopicMapId(String address)
INTERNAL: Gets the numeric topic map id from an RDBMS URI or a simple topic map id reference.static TopicMapWriterIF
getWriter(File tmfile)
PUBLIC: Given the file for a topicmap, returns a topicmap writer of the right class.static TopicMapWriterIF
getWriter(File tmfile, String encoding)
PUBLIC: Given the file for a topicmap, returns a topicmap writer of the right class.
-
-
-
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.
-
-