1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| package com.oying.utils;
|
| import java.io.Closeable;
|
| /**
| * @author Z
| * @description 用于关闭各种连接,缺啥补啥
| * @date 2021-03-05
| **/
| public class CloseUtil {
|
| public static void close(Closeable closeable) {
| if (null != closeable) {
| try {
| closeable.close();
| } catch (Exception e) {
| // 静默关闭
| }
| }
| }
|
| public static void close(AutoCloseable closeable) {
| if (null != closeable) {
| try {
| closeable.close();
| } catch (Exception e) {
| // 静默关闭
| }
| }
| }
| }
|
|