Workaround possible GraalVM issue

This commit is contained in:
AsamK 2022-07-27 20:58:58 +02:00
parent 1cc21834e2
commit 7a42737287

View file

@ -121,13 +121,13 @@ public class IOUtils {
return socketAddress; return socketAddress;
} }
public static UnixDomainPrincipal getUnixDomainPrincipal(final SocketChannel channel) throws IOException { public static String getUnixDomainPrincipal(final SocketChannel channel) throws IOException {
UnixDomainPrincipal principal = null; UnixDomainPrincipal principal = null;
try { try {
principal = channel.getOption(ExtendedSocketOptions.SO_PEERCRED); principal = channel.getOption(ExtendedSocketOptions.SO_PEERCRED);
} catch (UnsupportedOperationException | NoClassDefFoundError ignored) { } catch (UnsupportedOperationException | NoClassDefFoundError ignored) {
} }
return principal; return principal == null ? null : principal.toString();
} }
public static ServerSocketChannel bindSocket(final SocketAddress address) throws IOErrorException { public static ServerSocketChannel bindSocket(final SocketAddress address) throws IOErrorException {