/** * Constructor that accepts a filename as argument. */ public JSPPageReader(File source) throws java.net.MalformedURLException { this.file = URIUtils.toURL(source); }
private File getFileFor(TopicMapIF topicmap) { try { return URIUtils.getURIFile(topicmap.getStore().getBaseAddress()); } catch (MalformedURLException e) { return null; } }
LocatorIF baseloc = (outfile == null ? store.getBaseAddress() : URIUtils.getFileURI(new File(outfile))); if (baseloc == null && tmurl != null) baseloc = (ohandler.baseuri == null ? URIUtils.getURI(tmurl) : URIUtils.getURI(ohandler.baseuri));
else seenFirstPair = true; urlQuery.append(key).append("=").append(URIUtils.urlEncode(val, charenc));
Collection<LocatorIF> reifier_subinds = new HashSet<LocatorIF>(); LocatorIF versionTopicPSI = URIUtils.getURILocator("http://psi.ontopia.net/ontology/ted-ontology-version"); if (newtopicmap) {
public List getRecentFiles() { ArrayList topics = new ArrayList(typeIndex.getTopics(recentLoaded)); Collections.sort(topics, new Comparator() { @Override public int compare(Object a, Object b) { TopicIF topicA = (TopicIF) a; TopicIF topicB = (TopicIF) b; String valueA = getOccurrenceValue(topicA, timestamp); String valueB = getOccurrenceValue(topicB, timestamp); return valueB.compareTo(valueA); } }); ArrayList result = new ArrayList(topics.size()); for (Iterator iter = topics.iterator(); iter.hasNext();) { TopicIF topic = (TopicIF) iter.next(); LocatorIF locator = (LocatorIF)CollectionUtils.getFirst(topic.getSubjectLocators()); File file = null; try { file = URIUtils.getURIFile(locator); } catch (MalformedURLException e) { // For 2.1 compatability file = new File(locator.getAddress()); } if (file != null) result.add(file); } return result; }
/** * PUBLIC: Sets the file from which the reader will read the * RDF-to-topic map mapping definition. The syntax will be assumed * to be "RDF/XML". */ public void setMappingFile(File mappingfile) { this.mappingurl = URIUtils.toURL(mappingfile); }
/** * INTERNAL: Saves the system topic map to disk. */ private void saveSystemTopicMap(TopicMapIF systemtm) { try { LocatorIF base = systemtm.getStore().getBaseAddress(); File file = URIUtils.getURIFile(base); FileOutputStream stream = new FileOutputStream(file); new LTMTopicMapWriter(stream).write(systemtm); stream.close(); } catch (IOException e) { throw new OntopiaRuntimeException(e); } }
/** * PUBLIC: Creates a reader that will read RDF from the given file in * the indicated syntax. * @param syntax The RDF syntax to use. Possible values are "RDF/XML", "N3", * "N-TRIPLE". If the value is null it defaults to "RDF/XML". */ public RDFTopicMapReader(File infile, String syntax) { this(URIUtils.toURL(infile), syntax); }
/** * INTERNAL: Saves the system topic map to disk. */ private void saveSystemTopicMap(TopicMapIF systemtm) { try { LocatorIF base = systemtm.getStore().getBaseAddress(); File file = URIUtils.getURIFile(base); new LTMTopicMapWriter(file).write(systemtm); } catch (IOException e) { throw new OntopiaRuntimeException(e); } }
/** * PUBLIC: Sets the file from which the reader will read the * RDF-to-topic map mapping definition. * @param syntax The RDF syntax to use. Possible values are "RDF/XML", "N3", * "N-TRIPLE". If the value is null it defaults to "RDF/XML". */ public void setMappingFile(File mappingfile, String syntax) { this.mappingurl = URIUtils.toURL(mappingfile); this.mappingsyntax = syntax; }
/** * Constructor initializes the configuration by loading a topic map from the * URL given in the parameter. */ public VizConfigurationManager(File tmfile) throws IOException { this(URIUtils.toURL(tmfile)); }
public AbstractTopicMapReader(File file) throws MalformedURLException { this(URIUtils.toURL(file)); }
public AbstractXMLFormatReader(File file) throws MalformedURLException { this(URIUtils.toURL(file)); }
@Override public URL getResource(String path) throws MalformedURLException { File respath = new File(rootpath, path); return URIUtils.toURL(respath); }
/** * 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'. * * @since 2.0 */ public static TopicMapReaderIF getReader (File file) throws IOException { return getReader(URIUtils.toURL(file)); }
/** * PUBLIC: Creates a reader bound to the given file. */ public OSLSchemaReader(File file) { try { source = new InputSource(URIUtils.toURL(file).toExternalForm()); base_address = new URILocator(URIUtils.toURL(file).toExternalForm()); } catch (MalformedURLException e) { throw new OntopiaRuntimeException("INTERNAL ERROR: " + e); } }
public static NavigatorConfigurationIF getConfiguration(File specfile) throws SAXException, IOException { return getConfiguration(new InputSource(URIUtils.toURL(specfile).toExternalForm())); }
/** * INTERNAL: Returns a collection containing the topic map sources * created by reading the configuration file. */ public static List<TopicMapSourceIF> readSources(String config_file, Map<String, String> environ) { if (environ == null) environ = new HashMap<String, String>(1); // add CWD entry if (!environ.containsKey(CWD)) { File file = new File(config_file); if (!file.exists()) throw new OntopiaRuntimeException("Config file '" + config_file + "' does not exist."); environ.put(CWD, file.getParent()); } return readSources(new InputSource(URIUtils.toURL(new File(config_file)).toString()), environ); }
if (f.exists()) { log.debug(MSG_FILE_LOADED_FROM_FILE_SYSTEM + name); url = URIUtils.toURL(f); } else throw new IOException("File '" + f + "' not found."); if (f.exists()) { log.debug(MSG_FILE_LOADED_FROM_FILE_SYSTEM + name); url = URIUtils.toURL(f); } else { ClassLoader cl = Thread.currentThread().getContextClassLoader();