public class ResourcesUtils extends Object
构造器和说明 |
---|
ResourcesUtils() |
限定符和类型 | 方法和说明 |
---|---|
static InputStream |
getResourceAsStream(String resourceName)
Opens a resource of the specified name for reading.
|
static InputStream |
getResourceAsStream(String resourceName,
ClassLoader callingClass)
Opens a resource of the specified name for reading.
|
static URL |
getResourceUrl(String resourceName,
ClassLoader classLoader)
Retrieves given resource as URL.
|
public static URL getResourceUrl(String resourceName, ClassLoader classLoader)
Resource will be loaded using class loaders in the following order:
Thread.currentThread().getContextClassLoader()
ClassLoaderUtil.class.getClassLoader()
callingClass
is provided: callingClass.getClassLoader()
public static InputStream getResourceAsStream(String resourceName) throws IOException
public static InputStream getResourceAsStream(String resourceName, ClassLoader callingClass) throws IOException
Copyright © 2023. All rights reserved.