de.gesellix.docker.client.filesocket.FileSocketFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docker-filesocket Show documentation
Show all versions of docker-filesocket Show documentation
Unix Domain Sockets and Named Pipes for the JVM on Linux, macOS, and Windows
The newest version!
package de.gesellix.docker.client.filesocket;
import okhttp3.Dns;
import javax.net.SocketFactory;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Collections;
import java.util.List;
public abstract class FileSocketFactory extends SocketFactory implements Dns {
@Override
public List lookup(String hostname) throws UnknownHostException {
if (hostname.endsWith(FileSocket.SOCKET_MARKER)) {
return Collections.singletonList(InetAddress.getByAddress(hostname, new byte[] {0, 0, 0, 0}));
}
else {
return Dns.SYSTEM.lookup(hostname);
}
}
@Override
public Socket createSocket(String s, int i) {
throw new UnsupportedOperationException();
}
@Override
public Socket createSocket(String s, int i, InetAddress inetAddress, int i1) {
throw new UnsupportedOperationException();
}
@Override
public Socket createSocket(InetAddress inetAddress, int i) {
throw new UnsupportedOperationException();
}
@Override
public Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress1, int i1) {
throw new UnsupportedOperationException();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy