package de.siphalor.was.content.resource;

import org.jetbrains.annotations.Nullable;

import java.io.InputStream;

/**
 * A representation for some kind of resource.
 */
public abstract class Resource {
	/**
	 * The resource's id
	 */
	private final String id;

	/**
	 * Constructs a new resource with the given id.
	 * @param id The id
	 */
	protected Resource(String id) {
		this.id = id;
	}

	/**
	 * Gets an input stream for this resource.
	 * @return An input stream to the resource
	 */
	@Nullable
	public abstract InputStream getInputStream();

	/**
	 * Gets the id of this resource. Usually namespaced
	 * @return The id
	 */
	public String getId() {
		return id;
	}
}
