Skip to content

Commit

Permalink
Simplify PebbleTemplateAvailabilityProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
ebussieres committed Jul 5, 2018
1 parent 282d4e8 commit 0229ac7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ 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(ResourceLoader.CLASSPATH_URL_PREFIX + prefix + view + suffix).exists();
} else {
return false;
return resourceLoader.getResource(prefix + view + suffix).exists();
}
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ 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(ResourceLoader.CLASSPATH_URL_PREFIX + prefix + view + suffix).exists();
} else {
return false;
return resourceLoader.getResource(prefix + view + suffix).exists();
}
return false;
}

}

0 comments on commit 0229ac7

Please sign in to comment.