Class Util


  • public class Util
    extends java.lang.Object
    Collection of utility methods.
    • Constructor Summary

      Constructors 
      Constructor Description
      Util()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.xml.sax.InputSource getInputSource​(java.lang.String fileOrURL)
      Gets an InputSource from a string, which contains either a file name or an URL.
      static boolean isAbsoluteURI​(java.lang.String uri)
      Checks if a given string is an absolute URI if it is an URI.
      static java.lang.String which​(java.lang.Class clazz)  
      static java.lang.String which​(java.lang.String classname, java.lang.ClassLoader loader)
      Search the specified classloader for the given classname.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Util

        public Util()
    • Method Detail

      • getInputSource

        public static org.xml.sax.InputSource getInputSource​(java.lang.String fileOrURL)
        Gets an InputSource from a string, which contains either a file name or an URL.
      • isAbsoluteURI

        public static boolean isAbsoluteURI​(java.lang.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 java.lang.String which​(java.lang.Class clazz)
      • which

        public static java.lang.String which​(java.lang.String classname,
                                             java.lang.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