Package org.apache.ofbiz.base.util
Class UtilURL
java.lang.Object
org.apache.ofbiz.base.util.UtilURL
URL Utilities - Simple Class for flexibly working with properties files
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> URL
static URL
fromFilename
(String filename) static URL
fromOfbizHomePath
(String filename) static <C> URL
fromResource
(Class<C> contextClass, String resourceName) static URL
fromResource
(String resourceName) Returns aURL
instance from a resource name.static URL
fromResource
(String resourceName, ClassLoader loader) Returns aURL
instance from a resource name.static URL
fromUrlString
(String urlString) static String
getOfbizHomeRelativeLocation
(URL fileUrl)
-
Method Details
-
fromClass
-
fromResource
Returns aURL
instance from a resource name. Returnsnull
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
-
fromResource
Returns aURL
instance from a resource name. Returnsnull
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
-
fromUrlString
-
fromOfbizHomePath
-
getOfbizHomeRelativeLocation
-