Class UtilURL

java.lang.Object
org.apache.ofbiz.base.util.UtilURL

public final class UtilURL extends Object
URL Utilities - Simple Class for flexibly working with properties files
  • Method Details

    • fromClass

      public static <C> URL fromClass(Class<C> contextClass)
    • fromResource

      public static URL fromResource(String resourceName)
      Returns a URL instance from a resource name. Returns null if the resource is not found.

      This method uses various ways to locate the resource, and in all cases it tests to see if the resource exists - so it is very inefficient.

      Parameters:
      resourceName -
      Returns:
    • fromResource

      public static <C> URL fromResource(Class<C> contextClass, String resourceName)
    • fromResource

      public static URL fromResource(String resourceName, ClassLoader loader)
      Returns a URL instance from a resource name. Returns null if the resource is not found.

      This method uses various ways to locate the resource, and in all cases it tests to see if the resource exists - so it is very inefficient.

      Parameters:
      resourceName -
      loader -
      Returns:
    • fromFilename

      public static URL fromFilename(String filename)
    • fromUrlString

      public static URL fromUrlString(String urlString)
    • fromOfbizHomePath

      public static URL fromOfbizHomePath(String filename)
    • getOfbizHomeRelativeLocation

      public static String getOfbizHomeRelativeLocation(URL fileUrl)