Skip to content

Commit

Permalink
#464: Restaure default behaviour
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Bussieres <eric.bussieres@ssq.ca>
  • Loading branch information
Eric Bussieres committed Aug 22, 2019
1 parent 06270c5 commit 23245d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.ClassUtils;

import static org.springframework.core.io.ResourceLoader.CLASSPATH_URL_PREFIX;

public class PebbleTemplateAvailabilityProvider implements TemplateAvailabilityProvider {

@Override
Expand All @@ -16,7 +18,7 @@ public boolean isTemplateAvailable(String view, Environment environment, ClassLo
PropertyResolver resolver = new RelaxedPropertyResolver(environment, "pebble.");
String prefix = resolver.getProperty("prefix", PebbleProperties.DEFAULT_PREFIX);
String suffix = resolver.getProperty("suffix", PebbleProperties.DEFAULT_SUFFIX);
return resourceLoader.getResource(prefix + view + suffix).exists();
return resourceLoader.getResource(CLASSPATH_URL_PREFIX + prefix + view + suffix).exists();
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.ClassUtils;

import static org.springframework.core.io.ResourceLoader.CLASSPATH_URL_PREFIX;

public class PebbleTemplateAvailabilityProvider implements TemplateAvailabilityProvider {

@Override
Expand All @@ -13,7 +15,7 @@ public boolean isTemplateAvailable(String view, Environment environment, ClassLo
if (ClassUtils.isPresent("com.mitchellbosecke.pebble.PebbleEngine", classLoader)) {
String prefix = environment.getProperty("pebble.prefix", PebbleProperties.DEFAULT_PREFIX);
String suffix = environment.getProperty("pebble.suffix", PebbleProperties.DEFAULT_SUFFIX);
return resourceLoader.getResource(prefix + view + suffix).exists();
return resourceLoader.getResource(CLASSPATH_URL_PREFIX + prefix + view + suffix).exists();
}
return false;
}
Expand Down

0 comments on commit 23245d3

Please sign in to comment.