2023年2月22日

打印 printStackTrace 到日志

摘要: log.error("电签流程生成pdf失败 start "); ByteArrayOutputStream baos = new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(baos)); String exception 阅读全文

posted @ 2023-02-22 21:18 何苦-> 阅读(79) 评论(0) 推荐(0)

关于System.getProperty("java.io.tmpdir");的输出,及System.getProperty();参数

摘要: 首先来介绍下System.getProperty("java.io.tmpdir")输出因为这个输出有点特殊。 理论介绍:他是获取系统临时目录。可以是window的temp,linux的临时目录等。 实际:实际上他获取的有时候并不是我们想要获取的。比如一个web程序:如果你不用tomcat,直接一个 阅读全文

posted @ 2023-02-22 10:34 何苦-> 阅读(301) 评论(0) 推荐(0)

Linux临时目录/tmp与/var/tmp

摘要: Linux有两个公知的临时目录:/tmp与/var/tmp,这两个目录被用户用于存储临时性的文件,亦经常被程读写用户存储临时性数据。 两个目录没有本质上的区别,最根本的区别仅仅是系统对其中文件清理的默认时间配置不一致。 /tmp 目录默认清理10天未用的文件,系统重启会清空目录 /var/tmp 目 阅读全文

posted @ 2023-02-22 10:21 何苦-> 阅读(894) 评论(0) 推荐(0)

java 获取当前系统 linux windows macos

摘要: hutool 工具类 <dependency> <groupId>com.github.oshi</groupId> <artifactId>oshi-core</artifactId> <version>5.6.1</version> </dependency> <!-- https://mvnr 阅读全文

posted @ 2023-02-22 10:05 何苦-> 阅读(911) 评论(0) 推荐(0)

导航