Class ResourceLoader

java.lang.Object
org.miaixz.bus.core.lang.loader.ResourceLoader
All Implemented Interfaces:
Loader
Direct Known Subclasses:
DelegateLoader, FileLoader, JarLoader, StdLoader

public abstract class ResourceLoader extends Object implements Loader
资源加载器
Since:
Java 17+
Author:
Kimi Liu
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    load(String path)
    加载指定路径的所有资源,等效于Loader.load(path, false, Filters.ALWAYS)的调用 通常情况下不递归加载,但是子类可以改变此方法的行为, 例如ANT风格路径的资源加载器可以根据传入表达式来判断是否递归加载
    load(String path, boolean recursively)
    加载指定路径的所有资源,等效于Loader.load(path, recursively, Filters.ALWAYS)的调用
    load(String path, Filter filter)
    加载指定路径的所有满足过滤条件的资源,等效于Loader.load(path, true, boot)的调用

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.miaixz.bus.core.lang.loader.Loader

    load, load
  • Constructor Details

    • ResourceLoader

      public ResourceLoader()
  • Method Details

    • load

      public Enumeration<Resource> load(String path) throws IOException
      Description copied from interface: Loader
      加载指定路径的所有资源,等效于Loader.load(path, false, Filters.ALWAYS)的调用 通常情况下不递归加载,但是子类可以改变此方法的行为, 例如ANT风格路径的资源加载器可以根据传入表达式来判断是否递归加载
      Specified by:
      load in interface Loader
      Parameters:
      path - 资源路径
      Returns:
      资源对象
      Throws:
      IOException - I/O 异常
    • load

      public Enumeration<Resource> load(String path, boolean recursively) throws IOException
      Description copied from interface: Loader
      加载指定路径的所有资源,等效于Loader.load(path, recursively, Filters.ALWAYS)的调用
      Specified by:
      load in interface Loader
      Parameters:
      path - 资源路径
      recursively - 递归加载
      Returns:
      资源枚举器
      Throws:
      IOException - I/O 异常
    • load

      public Enumeration<Resource> load(String path, Filter filter) throws IOException
      Description copied from interface: Loader
      加载指定路径的所有满足过滤条件的资源,等效于Loader.load(path, true, boot)的调用
      Specified by:
      load in interface Loader
      Parameters:
      path - 资源路径
      filter - 对象信息
      Returns:
      资源枚举器
      Throws:
      IOException - I/O 异常