File tree 1 file changed +6
-4
lines changed
platform/src/main/java/co/casterlabs/commons/platform 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
package co .casterlabs .commons .platform ;
2
2
3
+ import java .io .File ;
4
+ import java .io .FileInputStream ;
3
5
import java .io .IOException ;
4
6
import java .nio .charset .StandardCharsets ;
5
- import java .nio .file .Files ;
6
- import java .nio .file .Path ;
7
7
8
8
/**
9
9
* This class allows you to detect whether or not a machine uses GNU or MUSL
@@ -42,8 +42,10 @@ public static boolean isGNU() throws IOException {
42
42
}
43
43
44
44
private static boolean isGNUViaFS () throws IOException {
45
- String ldd = Files .readString (Path .of ("/usr/bin/ldd" ));
46
- return ldd .contains ("GNU C Library" );
45
+ try (FileInputStream fin = new FileInputStream (new File ("/usr/bin/ldd" ))) {
46
+ String ldd = _PlatformUtil .readInputStreamString (fin , StandardCharsets .UTF_8 );
47
+ return ldd .contains ("GNU C Library" );
48
+ }
47
49
}
48
50
49
51
private static boolean isGNUViaCommand () throws IOException {
You can’t perform that action at this time.
0 commit comments