// Path: src/main/java/org/jusecase/builders/Builder.java
// public interface Builder<T> {
//     T build();
// }
// 
// Path: src/main/java/org/jusecase/builders/BuilderException.java
// public class BuilderException extends RuntimeException {
//     public BuilderException(String message) {
//         super(message);
//     }
// 
//     public BuilderException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


import org.jusecase.builders.Builder;
import org.jusecase.builders.BuilderException;
import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;
package org.jusecase.builders.io;



public class FileBuilder implements Builder<File> {
    private String resource;

    public FileBuilder withResource(String resource) {
        this.resource = resource;
        if (resource == null) {
            throw new NullPointerException("Resource may not be null.");
        }
        return this;
    }

    @Override
    public File build() {
        if (resource == null) {
            return new File("");
        }

        URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
        if (url == null) {
            throw new BuilderException("Resource " + resource + " not found.");
        }

        try {
            return new File(url.toURI());
        } catch (URISyntaxException e) {
// Path: src/main/java/org/jusecase/builders/Builder.java
// public interface Builder<T> {
//     T build();
// }
// 
// Path: src/main/java/org/jusecase/builders/BuilderException.java
// public class BuilderException extends RuntimeException {
//     public BuilderException(String message) {
//         super(message);
//     }
// 
//     public BuilderException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: src/main/java/org/jusecase/builders/io/FileBuilder.java
import org.jusecase.builders.Builder;
import org.jusecase.builders.BuilderException;
import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;

package org.jusecase.builders.io;



public class FileBuilder implements Builder<File> {
    private String resource;

    public FileBuilder withResource(String resource) {
        this.resource = resource;
        if (resource == null) {
            throw new NullPointerException("Resource may not be null.");
        }
        return this;
    }

    @Override
    public File build() {
        if (resource == null) {
            return new File("");
        }

        URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
        if (url == null) {
            throw new BuilderException("Resource " + resource + " not found.");
        }

        try {
            return new File(url.toURI());
        } catch (URISyntaxException e) {
            throw new BuilderException("Resource " + resource + " not found.", e);