org.mulgara.jena.n3
Class IRIResolver

java.lang.Object
  extended by org.mulgara.jena.n3.IRIResolver

public class IRIResolver
extends Object

A simple class to access IRI resolution

Author:
Andy Seaborne, Jeremy Carroll

Constructor Summary
IRIResolver()
          Construct an IRIResolver with base as the current working directory.
IRIResolver(String baseS)
          Construct an IRIResolver with base determined by the argument URI.
 
Method Summary
static String chooseBaseURI()
          Choose a base URI based on the current directory
static String chooseBaseURI(String baseURI)
          Choose a baseURI based on a suggestion
 String getBaseIRI()
          The base of this IRIResolver.
 String resolve(String relURI)
          Resolve the relative URI against the base of this IRIResolver.
static String resolve(String relStr, String baseStr)
          Create resolve a URI against a base.
static String resolveFileURL(String filename)
          Turn a filename into a well-formed file: URL relative to the working directory.
static String resolveGlobal(String str)
          Resolve the relative URI str against the current working directory.
static void suppressExceptions()
          To allow Eyeball to bypass IRI checking (because it's doing its own)
static String toURL(String filename)
          Turn a plain filename into a "file:" URL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IRIResolver

public IRIResolver()
Construct an IRIResolver with base as the current working directory.


IRIResolver

public IRIResolver(String baseS)
Construct an IRIResolver with base determined by the argument URI. If this is relative, it is relative against the current working directory.

Parameters:
baseS -
Throws:
JenaURIException - If resulting base would not be legal, absolute IRI
Method Detail

resolveFileURL

public static String resolveFileURL(String filename)
                             throws com.hp.hpl.jena.iri.IRIException
Turn a filename into a well-formed file: URL relative to the working directory.

Parameters:
filename -
Returns:
String The filename as an absolute URL
Throws:
com.hp.hpl.jena.iri.IRIException

resolve

public static String resolve(String relStr,
                             String baseStr)
                      throws JenaURIException
Create resolve a URI against a base. If baseStr is a relative file IRI then it is first resolved against the current working directory.

Parameters:
relStr -
baseStr - Can be null if relStr is absolute
Returns:
String An absolute URI
Throws:
JenaURIException - If result would not be legal, absolute IRI

getBaseIRI

public String getBaseIRI()
The base of this IRIResolver.

Returns:
The string representation of the base.

resolve

public String resolve(String relURI)
Resolve the relative URI against the base of this IRIResolver.

Parameters:
relURI -
Returns:
the resolved IRI
Throws:
JenaURIException - If resulting URI would not be legal, absolute IRI

suppressExceptions

public static void suppressExceptions()
To allow Eyeball to bypass IRI checking (because it's doing its own)


resolveGlobal

public static String resolveGlobal(String str)
Resolve the relative URI str against the current working directory.

Parameters:
str -
Returns:
The resolved URI as a string.

chooseBaseURI

public static String chooseBaseURI()
Choose a base URI based on the current directory

Returns:
String Absolute URI

chooseBaseURI

public static String chooseBaseURI(String baseURI)
Choose a baseURI based on a suggestion

Returns:
String URI (if relative, relative to current working directory).

toURL

public static String toURL(String filename)
Turn a plain filename into a "file:" URL



Copyright © 2011. All Rights Reserved.