package de.siphalor.was.assets;

import org.jetbrains.annotations.NotNull;

import java.io.InputStream;
import java.net.URL;
import java.util.Optional;

public class AssetsManager {

	@NotNull
	public static Optional<InputStream> getStream(@NotNull String path) {
		return Optional.ofNullable(Thread.currentThread().getContextClassLoader().getResourceAsStream("assets/" + path));
	}

	@NotNull
	public static Optional<URL> getURL(@NotNull String path) {
		return Optional.ofNullable(Thread.currentThread().getContextClassLoader().getResource(path));
	}

}
