1 25 package org.ofbiz.base.location; 26 27 import java.net.MalformedURLException ; 28 import java.net.URL ; 29 30 import org.ofbiz.base.util.UtilURL; 31 32 39 40 public class ClasspathLocationResolver implements LocationResolver { 41 public URL resolveLocation(String location) throws MalformedURLException { 42 return resolveLocation(location, null); 43 } 44 45 public URL resolveLocation(String location, ClassLoader loader) throws MalformedURLException { 46 String baseLocation = FlexibleLocation.stripLocationType(location); 47 if (baseLocation.charAt(0) == '/') { 49 baseLocation = baseLocation.substring(1); 50 } 51 return UtilURL.fromResource(baseLocation, loader); 52 } 53 } 54 | Popular Tags |