com.sun.msv.util

Class Util

public class Util extends Object

Collection of utility methods.

Author: Kohsuke KAWAGUCHI

Method Summary
static InputSourcegetInputSource(String fileOrURL)
Gets an InputSource from a string, which contains either a file name or an URL.
static booleanisAbsoluteURI(String uri)
Checks if a given string is an absolute URI if it is an URI.
static Stringwhich(Class clazz)
static Stringwhich(String classname, ClassLoader loader)
Search the specified classloader for the given classname.

Method Detail

getInputSource

public static InputSource getInputSource(String fileOrURL)
Gets an InputSource from a string, which contains either a file name or an URL.

isAbsoluteURI

public static boolean isAbsoluteURI(String uri)
Checks if a given string is an absolute URI if it is an URI.

This method does not check whether it is an URI.

This implementation is based on this post.

which

public static String which(Class clazz)

which

public static String which(String classname, ClassLoader loader)
Search the specified classloader for the given classname.

Parameters: classname the fully qualified name of the class to search for loader the classloader to search

Returns: the source location of the resource, or null if it wasn't found