Package org.spongepowered.api.resource
Interface Resource
-
- All Superinterfaces:
AutoCloseable
@DoNotStore public interface Resource extends AutoCloseable
A resource can represent any kind of loaded data. It can be a file on the filesystem, a network location, or even generated at runtime. UseinputStream()
to retrieve the data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
InputStream
inputStream()
Returns theInputStream
of this resource.ResourcePath
path()
-
-
-
Method Detail
-
path
ResourcePath path()
- Returns:
- The
path
-
inputStream
InputStream inputStream()
Returns theInputStream
of this resource. Multiple calls to this method will not return a new object. To get a new object, get a new resource.- Returns:
- The input stream
-
close
void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
-