windows
URL resource = TmpFileHandle.class.getClassLoader().getResource(tplName);Objects.requireNonNull(resource, "模板【" + tplName + "】文件不存在");File resourceFile = new File(resource.getPath());
linux
ClassPathResource classPathResource = new ClassPathResource(tplName); // 获取文件输入流 InputStream inputStream = classPathResource.getInputStream(); List<String> list = IOUtils.readLines(inputStream);
docker
FROM common-registry.clamc.com:5000/common/java:8-jreVOLUME /tmpADD ./target/operation-xxx-ai.jar /app/ADD ./target/classes/tmpl/ClauseTmpl.tmpl /app/RUN echo "Asia/Shanghai" > /etc/timezone # 解决时间差RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime # 解决时间差ENTRYPOINT exec java ${JAVA_OPTS} -Duser.timezone=UTC+08:00 -Djava.security.egd=file:/dev/./urandom -jar /app/operation-xxx-ai.jar ${RUN_ARGS}EXPOSE 9417
File file = ResourceUtils.getFile(tplName);Path path = file.toPath();List<String> list = Files.readAllLines(path);