Package org.spongepowered.api.resource
Interface Resource
-
- All Superinterfaces:
java.lang.AutoCloseable
@DoNotStore public interface Resource extends java.lang.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()
java.io.InputStream
inputStream()
Returns theInputStream
of this resource.ResourcePath
path()
-
-
-
Method Detail
-
path
ResourcePath path()
- Returns:
- The
path
-
inputStream
java.io.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 java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.io.IOException
-
-