All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.core.photography.DarkroomFileSystem Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
package net.serenitybdd.core.photography;

import com.google.common.jimfs.Configuration;
import com.google.common.jimfs.Jimfs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.file.FileSystem;

public class DarkroomFileSystem {
    private static ThreadLocal fileSystemThreadLocal = new ThreadLocal<>();

    private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());

    public static FileSystem get() {
        if (fileSystemThreadLocal.get() == null) {
            fileSystemThreadLocal.set(Jimfs.newFileSystem(Configuration.unix()));
        }
        return fileSystemThreadLocal.get();
    }

    public static void close() {
        fileSystemThreadLocal.remove();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy