package org.xbib.files.jadaptive.sftp.test;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

public class SftpFileSystemTest {

    private static final Logger logger = Logger.getLogger(SftpFileSystemTest.class.getName());

    public SftpFileSystemTest() {
    }

    @Disabled("missing connection object")
    @Test
    public void testFileSystem() throws IOException {
        Map<String, ?> env = Map.of("username", "joerg");
        try (FileSystem fileSystem = FileSystems.newFileSystem(URI.create("abfs://xbib.org:22"), env)) {
            for (Path path : fileSystem.getRootDirectories()) {
                logger.log(Level.INFO, "root dir = " + path);
            }
        }
    }
}
