From d5371f7ebc913b6554ffe8e2cf79c0093584fbb1 Mon Sep 17 00:00:00 2001 From: Mitchell Bosecke Date: Sat, 8 Feb 2014 12:36:50 -0700 Subject: [PATCH] Renamed the classloaderloader to classpathloader. --- src/main/java/com/mitchellbosecke/pebble/PebbleEngine.java | 4 ++-- .../loader/{ClassLoaderLoader.java => ClasspathLoader.java} | 6 +++--- src/test/java/com/mitchellbosecke/pebble/LoaderTest.java | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) rename src/main/java/com/mitchellbosecke/pebble/loader/{ClassLoaderLoader.java => ClasspathLoader.java} (94%) diff --git a/src/main/java/com/mitchellbosecke/pebble/PebbleEngine.java b/src/main/java/com/mitchellbosecke/pebble/PebbleEngine.java index ec87b8476..d77ea8155 100644 --- a/src/main/java/com/mitchellbosecke/pebble/PebbleEngine.java +++ b/src/main/java/com/mitchellbosecke/pebble/PebbleEngine.java @@ -40,7 +40,7 @@ import com.mitchellbosecke.pebble.lexer.Lexer; import com.mitchellbosecke.pebble.lexer.LexerImpl; import com.mitchellbosecke.pebble.lexer.TokenStream; -import com.mitchellbosecke.pebble.loader.ClassLoaderLoader; +import com.mitchellbosecke.pebble.loader.ClasspathLoader; import com.mitchellbosecke.pebble.loader.DelegatingLoader; import com.mitchellbosecke.pebble.loader.FileLoader; import com.mitchellbosecke.pebble.loader.Loader; @@ -125,7 +125,7 @@ public PebbleEngine(Loader loader) { // set up a default loader if necessary if (loader == null) { List defaultLoadingStrategies = new ArrayList<>(); - defaultLoadingStrategies.add(new ClassLoaderLoader()); + defaultLoadingStrategies.add(new ClasspathLoader()); defaultLoadingStrategies.add(new FileLoader()); loader = new DelegatingLoader(defaultLoadingStrategies); } diff --git a/src/main/java/com/mitchellbosecke/pebble/loader/ClassLoaderLoader.java b/src/main/java/com/mitchellbosecke/pebble/loader/ClasspathLoader.java similarity index 94% rename from src/main/java/com/mitchellbosecke/pebble/loader/ClassLoaderLoader.java rename to src/main/java/com/mitchellbosecke/pebble/loader/ClasspathLoader.java index aed7cc8d2..083dc2576 100644 --- a/src/main/java/com/mitchellbosecke/pebble/loader/ClassLoaderLoader.java +++ b/src/main/java/com/mitchellbosecke/pebble/loader/ClasspathLoader.java @@ -21,9 +21,9 @@ import com.mitchellbosecke.pebble.error.LoaderException; -public class ClassLoaderLoader implements Loader { +public class ClasspathLoader implements Loader { - private static final Logger logger = LoggerFactory.getLogger(ClassLoaderLoader.class); + private static final Logger logger = LoggerFactory.getLogger(ClasspathLoader.class); private String prefix; @@ -52,7 +52,7 @@ public Reader getReader(String templateName) throws LoaderException { String location = path.toString() + templateName + (getSuffix() == null ? "" : getSuffix()); logger.debug("Looking for template in {}.", location); - ClassLoader rcl = ClassLoaderLoader.class.getClassLoader(); + ClassLoader rcl = ClasspathLoader.class.getClassLoader(); if (is == null) { is = rcl.getResourceAsStream(location); } diff --git a/src/test/java/com/mitchellbosecke/pebble/LoaderTest.java b/src/test/java/com/mitchellbosecke/pebble/LoaderTest.java index d8fe67215..a776fa3c6 100644 --- a/src/test/java/com/mitchellbosecke/pebble/LoaderTest.java +++ b/src/test/java/com/mitchellbosecke/pebble/LoaderTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import com.mitchellbosecke.pebble.error.PebbleException; -import com.mitchellbosecke.pebble.loader.ClassLoaderLoader; +import com.mitchellbosecke.pebble.loader.ClasspathLoader; import com.mitchellbosecke.pebble.loader.FileLoader; import com.mitchellbosecke.pebble.loader.Loader; import com.mitchellbosecke.pebble.template.PebbleTemplate; @@ -19,7 +19,7 @@ public class LoaderTest extends AbstractTest { @Test public void testClassLoaderLoader() throws PebbleException, IOException { - Loader loader = new ClassLoaderLoader(); + Loader loader = new ClasspathLoader(); loader.setPrefix("templates"); PebbleEngine engine = new PebbleEngine(loader); PebbleTemplate template1 = engine.compile("template.loaderTest.peb"); @@ -31,7 +31,7 @@ public void testClassLoaderLoader() throws PebbleException, IOException { @Test public void testClassLoaderLoaderWithNestedTemplate() throws PebbleException, IOException { - Loader loader = new ClassLoaderLoader(); + Loader loader = new ClasspathLoader(); loader.setPrefix("templates"); PebbleEngine engine = new PebbleEngine(loader); PebbleTemplate template1 = engine.compile("loader/template.loaderTest.peb");