<commit_before>package hudson.remoting;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;

/**
 * {@link JarCache} that stores files in a single directory.
 *
 * @author <NAME>
 */
public class FileSystemJarCache extends JarCacheSupport {
    public final File rootDir;

    private final boolean touch;

    /**
     * @param touch
     *      True to touch the cached jar file that's used. This enables external LRU based cache
     *      eviction at the expense of increased I/O.
     */
    public FileSystemJarCache(File rootDir, boolean touch) {
        this.rootDir = rootDir;
        this.touch = touch;
    }

    @Override
    protected URL lookInCache(Channel channel, long sum1, long sum2) throws IOException {
        File jar = map(sum1, sum2);
        if (jar.exists()) {
            if (touch)  jar.setLastModified(System.currentTimeMillis());
            return jar.toURI().toURL();
        }
        return null;
    }

    @Override
    protected URL retrieve(Channel channel, long sum1, long sum2, JarLoader jl) throws IOException, InterruptedException {
        File target = map(sum1, sum2);
        File parent = target.getParentFile();
        parent.mkdirs();
        File tmp = File.createTempFile(target.getName(),"tmp", parent);
        try {
            RemoteOutputStream o = new RemoteOutputStream(new FileOutputStream(tmp));
            try {<commit_msg>File(File,String) doesn't detect flag an error if the first parameter is null.<commit_after>package hudson.remoting;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;

/**
 * {@link JarCache} that stores files in a single directory.
 *
 * @author <NAME>
 */
public class FileSystemJarCache extends JarCacheSupport {
    public final File rootDir;

    private final boolean touch;

    /**
     * @param touch
     *      True to touch the cached jar file that's used. This enables external LRU based cache
     *      eviction at the expense of increased I/O.
     */
    public FileSystemJarCache(File rootDir, boolean touch) {
        this.rootDir = rootDir;
        this.touch = touch;
        if (rootDir==null)
            throw new IllegalArgumentException();
    }

    @Override
    protected URL lookInCache(Channel channel, long sum1, long sum2) throws IOException {
        File jar = map(sum1, sum2);
        if (jar.exists()) {
            if (touch)  jar.setLastModified(System.currentTimeMillis());
            return jar.toURI().toURL();
        }
        return null;
    }

    @Override
    protected URL retrieve(Channel channel, long sum1, long sum2, JarLoader jl) throws IOException, InterruptedException {
        File target = map(sum1, sum2);
        File parent = target.getParentFile();
        parent.mkdirs();
        File tmp = File.createTempFile(target.getName(),"tmp", parent);
        try {
            RemoteOutputStream o = new RemoteOutputStream(new FileOutputStream(tmp));
            try {
{'fraction_non_alphanumeric': 0.09457671957671958, 'fraction_numerical': 0.005291005291005291, 'mean_word_length': 2.6533816425120773, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1212557', 'n_tokens_mistral': 831, 'n_tokens_neox': 815, 'n_words': 264}