mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-23 02:56:59 -04:00
attempt to fix socket on Windows
This commit is contained in:
@@ -6,7 +6,9 @@ import org.slf4j.LoggerFactory;
|
||||
import java.io.IOException;
|
||||
import java.net.UnixDomainSocketAddress;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
class Client implements IpcCommunicator {
|
||||
@@ -20,6 +22,8 @@ class Client implements IpcCommunicator {
|
||||
}
|
||||
|
||||
public static Client create(Path socketPath) throws IOException {
|
||||
// fail with NoSuchFileException early to prevent implicit creation of socket on Windows:
|
||||
socketPath.getFileSystem().provider().checkAccess(socketPath);
|
||||
var address = UnixDomainSocketAddress.of(socketPath);
|
||||
var socketChannel = SocketChannel.open(address);
|
||||
LOG.info("Connected to IPC server on UNIX socket {}", socketPath);
|
||||
|
||||
Reference in New Issue
Block a user