Class DefaultResourceResolver
java.lang.Object
com.helger.commons.io.resourceresolver.DefaultResourceResolver
- All Implemented Interfaces:
IHasConditionalLogger
A simple resource resolver that can handle URLs, JAR files and file system
resources.
- Since:
- 8.6.6
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IReadableResourcegetResolvedResource(String sSystemId, String sBaseURI) Do the standard resource resolving of sSystemId relative to sBaseURIstatic IReadableResourcegetResolvedResource(String sSystemId, String sBaseURI, ClassLoader aClassLoader) Do the standard resource resolving of sSystemId relative to sBaseURIstatic booleanstatic booleanisExplicitJarFileResource(String sName) static voidsetDebugResolve(boolean bDebugResolve)
-
Constructor Details
-
DefaultResourceResolver
protected DefaultResourceResolver()
-
-
Method Details
-
isDebugResolve
public static boolean isDebugResolve() -
setDebugResolve
public static void setDebugResolve(boolean bDebugResolve) -
isExplicitJarFileResource
-
getResolvedResource
@Nonnull public static IReadableResource getResolvedResource(@Nullable String sSystemId, @Nullable String sBaseURI) Do the standard resource resolving of sSystemId relative to sBaseURI- Parameters:
sSystemId- The resource to search. May benullif base URI is set.sBaseURI- The base URI from where the search is initiated. May benullif systemId is set.- Returns:
- The non-
nullresource. May be non-existing! - Throws:
UncheckedIOException- In case the file resolution (to an absolute file) fails.
-
getResolvedResource
@Nonnull public static IReadableResource getResolvedResource(@Nullable String sSystemId, @Nullable String sBaseURI, @Nullable ClassLoader aClassLoader) Do the standard resource resolving of sSystemId relative to sBaseURI- Parameters:
sSystemId- The resource to search. May be relative to the base URI or absolute. May benullif base URI is set.sBaseURI- The base URI from where the search is initiated. May benullif sSystemId is set.aClassLoader- The class loader to be used forClassPathResourceobjects. May benullin which case the default class loader is used.- Returns:
- The non-
nullresource. May be non-existing! - Throws:
UncheckedIOException- In case the file resolution (to an absolute file) fails.
-