Skip to content

Commit

Permalink
Codacy comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jemacineiras committed Oct 16, 2024
1 parent ce80741 commit 341dd00
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.sngular.api.generator.plugin.common.template;

import com.sngular.api.generator.plugin.openapi.template.ClasspathTemplateLoader;
import freemarker.cache.TemplateLoader;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
Expand All @@ -8,21 +11,13 @@
import java.util.List;
import java.util.Map;

import com.sngular.api.generator.plugin.openapi.template.ClasspathTemplateLoader;
import freemarker.cache.TemplateLoader;


public abstract class CommonTemplateLoader implements TemplateLoader {

private final Map<String, String> templatesMap = new HashMap<>();

protected static final ClassLoader LOADER = ClasspathTemplateLoader.class.getClassLoader();


protected String readFile(final InputStream file) throws IOException {
return new String(file.readAllBytes());
}

protected static final List<String> TEMPLATE_MODEL_FILES = List.of(CommonTemplateIndexConstants.TEMPLATE_CONTENT_SCHEMA,
CommonTemplateIndexConstants.TEMPLATE_CONTENT_ENUM, CommonTemplateIndexConstants.TEMPLATE_CONTENT_SCHEMA_LOMBOK, CommonTemplateIndexConstants.TEMPLATE_MODEL_EXCEPTION);

Expand Down Expand Up @@ -52,6 +47,10 @@ protected CommonTemplateLoader() {

}

protected String readFile(final InputStream file) throws IOException {
return new String(file.readAllBytes());
}

protected void init(final Map<String, String> resourceFiles) {
templatesMap.putAll(resourceFiles);
}
Expand Down

0 comments on commit 341dd00

Please sign in to comment.