<commit_before>/*******************************************************************************
 * Copyright (c) 2012 <NAME>. All rights reserved.
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * Contributors:
 *     <NAME> - initial API and implementation
 *******************************************************************************/

import java.nio.file.DirectoryStream;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.spi.FileSystemProvider;
import java.util.List;
import java.util.jar.JarOutputStream;
import java.util.zip.ZipEntry;

public class FileSystemProviderAPI {
    public static void main(String[] args) throws Exception {
        List<FileSystemProvider> providers = FileSystemProvider.installedProviders();
        for (FileSystemProvider fsProvider : providers) {
            System.out.println(fsProvider.getScheme() + ": " + fsProvider.getClass());
        }
        Path tmpFile = Files.createTempFile("", ".tmp");
        Files.write(tmpFile, "Hello".getBytes());
        Path jarFile = Files.createTempFile("", ".jar");
        JarOutputStream outputStream = new JarOutputStream(Files.newOutputStream(jarFile));
        outputStream.putNextEntry(new ZipEntry("Hello"));
        Files.copy(tmpFile, outputStream);
        outputStream.close();
        FileSystem fileSystem = FileSystems.newFileSystem(jarFile, FileSystemProviderAPI.class.getClassLoader());
        System.out.println(fileSystem);
        Iterable<Path> directories = fileSystem.getRootDirectories();
        for (Path path2 : directories) {
            System.out.println(path2.toUri());
            DirectoryStream<Path> stream = Files.newDirectoryStream(path2);
            for (Path path3 : stream) {
                System.out.println(path3);
            }
        }

    }
}<commit_msg>Simplified code<commit_after>/*******************************************************************************
 * Copyright (c) 2012 <NAME>. All rights reserved.
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * Contributors:
 *     <NAME> - initial API and implementation
 *******************************************************************************/

import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.spi.FileSystemProvider;
import java.util.List;
import java.util.jar.JarOutputStream;
import java.util.zip.ZipEntry;

public class FileSystemProviderAPI {
    public static void main(String[] args) throws Exception {
        List<FileSystemProvider> providers = FileSystemProvider.installedProviders();
        for (FileSystemProvider fsProvider : providers) {
            System.out.println("sheme: '" + fsProvider.getScheme() + "', provider: " + fsProvider.getClass());
        }

        Path tmpFile = Files.createTempFile("", ".tmp");
        Files.write(tmpFile, "Hello".getBytes());
        Path jarFile = Files.createTempFile("", ".jar");

        try(JarOutputStream outputStream = new JarOutputStream(Files.newOutputStream(jarFile))){
            outputStream.putNextEntry(new ZipEntry(tmpFile.getFileName().toString()));
            Files.copy(tmpFile, outputStream);
        }

        try(FileSystem fileSystem = createVirtualFS(jarFile)){
            Iterable<Path> directories = fileSystem.getRootDirectories();
            for (Path dir : directories) {
                System.out.println("Reading dir: " + dir.toUri());
                DirectoryStream<Path> stream = Files.newDirectoryStream(dir);
                for (Path file : stream) {
                    System.out.println("Reading file: " + file.toUri());
                    System.out.println("\tfrom " + file.getFileSystem().provider().getClass());
                    System.out.print("Content: ");
                    Files.copy(file, System.out);
                }
            }
        }

    }

    static FileSystem createVirtualFS(Path jarFile) throws IOException {
        return FileSystems.newFileSystem(jarFile, FileSystemProviderAPI.class.getClassLoader());
    }
}
{'fraction_non_alphanumeric': 0.17628979143798024, 'fraction_numerical': 0.004610318331503842, 'mean_word_length': 3.3807692307692307, 'pattern_counts': {'":': 1, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5192240', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1130, 'n_words': 256}