diff options
Diffstat (limited to 'src/main/java/com/google/escapevelocity/Template.java')
-rw-r--r-- | src/main/java/com/google/escapevelocity/Template.java | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/main/java/com/google/escapevelocity/Template.java b/src/main/java/com/google/escapevelocity/Template.java index 646c42b..3613dbe 100644 --- a/src/main/java/com/google/escapevelocity/Template.java +++ b/src/main/java/com/google/escapevelocity/Template.java @@ -11,6 +11,25 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package com.google.escapevelocity; import com.google.escapevelocity.EvaluationContext.PlainEvaluationContext; @@ -60,15 +79,12 @@ public class Template { * Parses a VTL template from the given {@code Reader}. The given Reader will be closed on * return from this method. */ - public static Template parseFrom(final Reader reader) throws IOException { - ResourceOpener resourceOpener = new ResourceOpener() { - @Override - public Reader openResource(String resourceName) throws IOException { - if (resourceName == null) { - return reader; - } else { - throw new IOException("No ResourceOpener has been configured to read " + resourceName); - } + public static Template parseFrom(Reader reader) throws IOException { + ResourceOpener resourceOpener = resourceName -> { + if (resourceName == null) { + return reader; + } else { + throw new IOException("No ResourceOpener has been configured to read " + resourceName); } }; try { |