package com.atlassian.bitbucket.internal.ssh.server;

import org.apache.sshd.common.file.FileSystemFactory;
import org.apache.sshd.common.session.Session;

import java.nio.file.FileSystem;

/**
 * A {@code FileSystemFactory} implementation which always throws an exception, ensuring remote users are never
 * able to get access to the local filesystem.
 *
 * @since 3.7
 */
public class ForbiddingFileSystemFactory implements FileSystemFactory {

    @Override
    public FileSystem createFileSystem(Session session) {
        throw new UnsupportedOperationException(session + " tried to get a FileSystem");
    }
}
