Interface PackageScanResourceResolver

    • Method Detail

      • getClassLoaders

        Set<ClassLoader> getClassLoaders()
        Gets the ClassLoader instances that should be used when scanning for resources.

        This implementation will return a new unmodifiable set containing the classloaders. Use the addClassLoader(ClassLoader) method if you want to add new classloaders to the class loaders list.

        Returns:
        the class loaders to use
      • addClassLoader

        void addClassLoader​(ClassLoader classLoader)
        Adds the class loader to the existing loaders
        Parameters:
        classLoader - the loader to add
      • setAcceptableSchemes

        void setAcceptableSchemes​(String schemes)
        To specify a set of accepted schemas to use for loading resources as URL connections (besides http and https schemas)
      • findResources

        Collection<Resource> findResources​(String location)
                                    throws Exception
        Finds the resources from the given location. The location can be prefixed with either file: or classpath: to look in either file system or classpath. By default classpath is assumed if no prefix is specified. Wildcards is supported using a ANT pattern style paths, such as classpath:**/*camel*.xml Notice when using wildcards, then there is additional overhead as the classpath is scanned, where as if you specific the exact name for each XML file is faster as no classpath scanning is needed.
        Parameters:
        location - the location (support ANT style patterns, eg routes/camel-*.xml)
        Returns:
        the found resources, or an empty collection if no resources found
        Throws:
        Exception - can be thrown during scanning for resources.
      • findResourceNames

        @Deprecated
        default Collection<String> findResourceNames​(String location)
                                              throws Exception
        Deprecated.
        Finds the resource names from the given location. The location can be prefixed with either file: or classpath: to look in either file system or classpath. By default classpath is assumed if no prefix is specified. Wildcards is supported using a ANT pattern style paths, such as classpath:**/*camel*.xml Notice when using wildcards, then there is additional overhead as the classpath is scanned, where as if you specific the exact name for each XML file is faster as no classpath scanning is needed.
        Parameters:
        location - the location (support ANT style patterns, eg routes/camel-*.xml)
        Returns:
        the found resource names, or an empty collection if no resources found
        Throws:
        Exception - can be thrown during scanning for resources.
      • findResourceStreams

        @Deprecated
        default Collection<InputStream> findResourceStreams​(String location)
                                                     throws Exception
        Deprecated.
        Finds the resources from the given location. The location can be prefixed with either file: or classpath: to look in either file system or classpath. By default classpath is assumed if no prefix is specified. Wildcards is supported using a ANT pattern style paths, such as classpath:**/*camel*.xml Notice when using wildcards, then there is additional overhead as the classpath is scanned, where as if you specific the exact name for each XML file is faster as no classpath scanning is needed. Important: Make sure to close the returned input streams after use.
        Parameters:
        location - the location (support ANT style patterns, eg routes/camel-*.xml)
        Returns:
        the found resources, or an empty collection if no resources found
        Throws:
        Exception - can be thrown during scanning for resources.