Class ClassLoaderUtils

java.lang.Object
org.frankframework.util.ClassLoaderUtils

public abstract class ClassLoaderUtils extends Object
  • Constructor Details

    • ClassLoaderUtils

      public ClassLoaderUtils()
  • Method Details

    • getResourceURL

      @Nullable public static URL getResourceURL(String resource)
      Get a resource-URL directly from the ClassPath
      Parameters:
      resource - name of the resource you are trying to fetch the URL from
      Returns:
      URL of the resource or null if it can't be not found
    • getResourceURL

      public static URL getResourceURL(@Nullable IScopeProvider scopeProvider, @Nonnull String resource)
      Get a resource-URL from a specific IConfigurationClassLoader. This should be used by classes which are part of the Ibis configuration (like pipes and senders) because the configuration might be loaded from outside the webapp ClassPath. Hence the Thread.currentThread().getContextClassLoader() at the time the class was instantiated should be used.
      See Also:
    • getResourceURL

      @Nullable public static URL getResourceURL(@Nullable IScopeProvider scopeProvider, @Nonnull String resource, @Nullable String allowedProtocols)
      Get a resource-URL from a ClassLoader, therefore the resource should not start with a leading slash
      Parameters:
      scopeProvider - to retrieve the file from, or NULL when you want to retrieve the resource directly from the ClassPath (using an absolute path)
      resource - name of the resource you are trying to fetch the URL from
      Returns:
      URL of the resource or null if it can't be not found
    • getAllowedProtocols

      @Nonnull public static List<String> getAllowedProtocols()
    • nameOf

      public static String nameOf(ClassLoader classLoader)
      If the classLoader is derivable of IConfigurationClassLoader return the className + configurationName, else return the className of the object. Don't return the package name to avoid cluttering the logs.