Class FlexibleLocation


  • public final class FlexibleLocation
    extends java.lang.Object
    A special location resolver that uses Strings like URLs, but with more options.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.net.URL resolveLocation​(java.lang.String location)
      Resolves the gives location into a URL object for use in various ways.
      static java.net.URL resolveLocation​(java.lang.String location, java.lang.ClassLoader loader)  
      static java.lang.String stripLocationType​(java.lang.String location)  
      • Methods inherited from class java.lang.Object

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

      • module

        public static final java.lang.String module
    • Method Detail

      • resolveLocation

        public static java.net.URL resolveLocation​(java.lang.String location)
                                            throws java.net.MalformedURLException
        Resolves the gives location into a URL object for use in various ways. The general format of the location is like a URL: {locationType}://location/path/file.ext Supports standard locationTypes like http, https, ftp, jar and file Supports a classpath location type for when desired to be used like any other URL Supports OFBiz specific location types like ofbizhome and component Supports additional locationTypes specified in the locationresolvers.properties file
        Parameters:
        location - The location String to parse and create a URL from
        Returns:
        URL object corresponding to the location String passed in
        Throws:
        java.net.MalformedURLException
      • resolveLocation

        public static java.net.URL resolveLocation​(java.lang.String location,
                                                   java.lang.ClassLoader loader)
                                            throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException
      • stripLocationType

        public static java.lang.String stripLocationType​(java.lang.String location)