Code example for URL

Methods: toExternalForm

0
    if (resName != null) {
      final ClassLoader loader = getClassLoader();
      if (loader != null) {
        final URL resource = loader.getResource(resName);
        if (resource != null) {
          return resource.toExternalForm();
        } 
      } 
    } 
    return ""; 
  } 
 
  private ClassLoader getClassLoader() {
    ClassLoader loader = myCachedLoader;
    if (loader == null) {
      myCachedLoader = loader = CustomAntElementsRegistry.createClassLoader(CustomAntElementsRegistry.collectUrls(this), getContextAntProject());
    } 
    return loader;
  } 
}