play.template2.GTTemplateLocationReal Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastergt Show documentation
Show all versions of fastergt Show documentation
RePlay is a fork of the Play1 framework, made and maintained by Codeborne.
The newest version!
package play.template2;
import java.net.URL;
import java.util.regex.Pattern;
import static java.util.regex.Pattern.CASE_INSENSITIVE;
import static java.util.regex.Pattern.DOTALL;
public class GTTemplateLocationReal extends GTTemplateLocation {
private static final Pattern scriptBlockRegex = Pattern.compile("", DOTALL | CASE_INSENSITIVE);
public final URL realFileURL;
public GTTemplateLocationReal(String relativePath, URL realFileURL) {
super(relativePath);
this.realFileURL = realFileURL;
}
@Override
public String readSource() {
String originalHtml = IO.readContentAsString(realFileURL);
return addInlineScriptTag(originalHtml);
}
String addInlineScriptTag(String originalHtml) {
return scriptBlockRegex.matcher(originalHtml).replaceAll("");
}
@Override
public String toString() {
return "GTTemplateLocationReal{" +
"realFile=" + realFileURL +
"} " + super.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy