public static NamespacePrefixService getInstance(){ if(INSTANCE == null){ try { INSTANCE = new StanbolNamespacePrefixService(new File(PREFIX_MAPPINGS)); } catch (IOException e) { throw new IllegalStateException("Unable to read "+PREFIX_MAPPINGS,e); } } return INSTANCE; }
public static NamespacePrefixService getInstance(){ if(INSTANCE == null){ try { INSTANCE = new StanbolNamespacePrefixService(new File(PREFIX_MAPPINGS)); } catch (IOException e) { throw new IllegalStateException("Unable to read "+PREFIX_MAPPINGS,e); } } return INSTANCE; }
/** * @param configDir * @throws IOException */ private void initNamespacePrefixMapper() throws IOException { File nsPrefixMappings = getConfigFile("namespaceprefix.mappings"); if(!nsPrefixMappings.isFile()){ FileUtils.writeLines(nsPrefixMappings,"UTF-8",Arrays.asList( "# Syntax: '{prefix}\\t{namespace}\\n", "# where:", "# {prefix} ... [0..9A..Za..z-_]", "# {namespace} ... must end with '#' or '/' for URLs and ':' for URNs", "# one mapping per line, multiple prefixes for the same namespace allowed")); } namespacePrefixService = new StanbolNamespacePrefixService(nsPrefixMappings); }
/** * @param configDir * @throws IOException */ private void initNamespacePrefixMapper() throws IOException { File nsPrefixMappings = getConfigFile("namespaceprefix.mappings"); if(!nsPrefixMappings.isFile()){ FileUtils.writeLines(nsPrefixMappings,"UTF-8",Arrays.asList( "# Syntax: '{prefix}\\t{namespace}\\n", "# where:", "# {prefix} ... [0..9A..Za..z-_]", "# {namespace} ... must end with '#' or '/' for URLs and ':' for URNs", "# one mapping per line, multiple prefixes for the same namespace allowed")); } namespacePrefixService = new StanbolNamespacePrefixService(nsPrefixMappings); }