Top Description Constructors Methods
com.sun.msv.util

public Class Util

extends Object
Class Inheritance
Imports
java.io.File, java.net.MalformedURLException, .URL, org.xml.sax.InputSource

Collection of utility methods.
Author
Kohsuke KAWAGUCHI

Constructor Summary

AccessConstructor and Description
public
Util()

Method Summary

Modifier and TypeMethod and Description
public static InputSource
getInputSource(String fileOrURL)

Gets an InputSource from a string, which contains either a file name or an URL.

public static boolean
isAbsoluteURI(String uri)

Checks if a given string is an absolute URI if it is an URI.

public static String
which(Class<?> clazz)

public static String

Returns:

the source location of the resource, or null if it wasn't found
which
(String
the fully qualified name of the class to search for
classname
,
ClassLoader
the classloader to search
loader
)

Search the specified classloader for the given classname.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Utilback to summary
public Util()

Method Detail

getInputSourceback to summary
public static InputSource getInputSource(String fileOrURL)

Gets an InputSource from a string, which contains either a file name or an URL.

isAbsoluteURIback to summary
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.

whichback to summary
public static String which(Class<?> clazz)
whichback to summary
public static String which(String classname, ClassLoader loader)

Search the specified classloader for the given classname.

Parameters
classname:String

the fully qualified name of the class to search for

loader:ClassLoader

the classloader to search

Returns:String

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