Utilize new enum for Resource prefixes.
Simplify ResourceLoaderResourceResolver.getResourceLoader() to use the new 'initialize' operator. Resolves gh-92.
This commit is contained in:
@@ -20,7 +20,6 @@ import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newI
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
@@ -34,10 +33,6 @@ import org.springframework.util.ClassUtils;
|
||||
@FunctionalInterface
|
||||
public interface ResourceResolver {
|
||||
|
||||
String CLASSPATH_URL_PREFIX = ResourceLoader.CLASSPATH_URL_PREFIX;
|
||||
String FILESYSTEM_URL_PREFIX = "file:";
|
||||
String RESOURCE_PATH_SEPARATOR = "/";
|
||||
|
||||
/**
|
||||
* Gets the {@link ClassLoader} used by this {@link ResourceResolver} to resolve {@literal classpath}
|
||||
* {@link Resource Resources}.
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.geode.core.io.support;
|
||||
|
||||
import static org.springframework.geode.core.util.ObjectUtils.initialize;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@@ -94,7 +96,7 @@ public class ResourceLoaderResourceResolver implements ResourceLoaderAware, Reso
|
||||
*/
|
||||
protected @NonNull ResourceLoader getResourceLoader() {
|
||||
return this.resolvedResourceLoader.updateAndGet(resourceLoader ->
|
||||
resourceLoader != null ? resourceLoader : newResourceLoader());
|
||||
initialize(resourceLoader, this::newResourceLoader));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user