Class DefaultResourceResolver
- java.lang.Object
-
- com.helger.commons.io.resourceresolver.DefaultResourceResolver
-
- All Implemented Interfaces:
IHasConditionalLogger
@Immutable public class DefaultResourceResolver extends Object implements 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 Modifier Constructor Description protectedDefaultResourceResolver()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 booleanisDebugResolve()static booleanisExplicitJarFileResource(String sName)static voidsetDebugResolve(boolean bDebugResolve)
-
-
-
Method Detail
-
isDebugResolve
public static boolean isDebugResolve()
-
setDebugResolve
public static void setDebugResolve(boolean bDebugResolve)
-
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.
-
-