<commit_before>package org.carlspring.strongbox.io;

import java.nio.file.FileSystem;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.Paths;
import java.nio.file.spi.FileSystemProvider;

import org.carlspring.strongbox.storage.repository.Repository;

/**
 * {@link RepositoryFileSystem} is a wrapper under concrete Storage {@link FileSystem}. <br>
 * The {@link RepositoryFileSystem} root is the {@link Repository}'s base directory.
 * 
 * @author <NAME>
 */
public class RepositoryFileSystem extends FileSystemWrapper
{
    private Repository repository;
    private FileSystemProvider fileSystemProvider;

    public RepositoryFileSystem(Repository repository,
                                FileSystem storageFileSystem,
                                FileSystemProvider provider)
    {
        super(storageFileSystem);
        this.repository = repository;
        this.fileSystemProvider = provider;
    }

    public RepositoryFileSystem(Repository repository,
                                FileSystem storageFileSystem)
    {
        this(repository, storageFileSystem, new RepositoryFileSystemProvider(storageFileSystem.provider()));
    }

    public Repository getRepository()
    {
        return repository;
    }

    public FileSystemProvider provider()
    {
        return fileSystemProvider;
    }

    public RepositoryPath getRootDirectory()
    {
        Path root = Paths.get(repository.getBasedir());
        FileSystem rootFileSystem = root.getFileSystem();
        return new RepositoryPath(root,
                new RepositoryFileSystem(repository, rootFileSystem,
                        new RepositoryFileSystemProvider(rootFileSystem.provider())));
    }

    public RepositoryPath getTrashPath()<commit_msg>SB-713: `StorageProvider` refactored to use `java.nio.file.Path` abstraction<commit_after>package org.carlspring.strongbox.io;

import java.nio.file.FileSystem;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.Paths;
import java.nio.file.spi.FileSystemProvider;

import org.carlspring.strongbox.storage.repository.Repository;

/**
 * {@link RepositoryFileSystem} is a wrapper under concrete Storage {@link FileSystem}. <br>
 * The {@link RepositoryFileSystem} root is the {@link Repository}'s base directory.
 * 
 * @author <NAME>
 */
public class RepositoryFileSystem extends FileSystemWrapper
{
    private Repository repository;
    private FileSystemProvider fileSystemProvider;

    public RepositoryFileSystem(Repository repository,
                                FileSystem storageFileSystem,
                                FileSystemProvider provider)
    {
        super(storageFileSystem);
        this.repository = repository;
        this.fileSystemProvider = provider;
    }

    public RepositoryFileSystem(Repository repository,
                                FileSystem storageFileSystem)
    {
        this(repository, storageFileSystem, new RepositoryFileSystemProvider(storageFileSystem.provider()));
    }

    public Repository getRepository()
    {
        return repository;
    }

    public FileSystemProvider provider()
    {
        return fileSystemProvider;
    }

    public RepositoryPath getRootDirectory()
    {
        Path root = Paths.get(repository.getBasedir());
        FileSystem rootFileSystem = root.getFileSystem();
        return new RepositoryPath(root,
                                  new RepositoryFileSystem(repository, rootFileSystem,
                                  new RepositoryFileSystemProvider(rootFileSystem.provider())));
    }

    public RepositoryPath getTrashPath()
{'fraction_non_alphanumeric': 0.07827519912112058, 'fraction_numerical': 0.0008239494644328481, 'mean_word_length': 2.886872998932764, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3878821', 'n_tokens_mistral': 913, 'n_tokens_neox': 884, 'n_words': 203}