Package net.neoforged.fml.jarcontents
Interface JarResource
- All Known Implementing Classes:
FolderJarContents.FileResource,JarFileContents.JarEntryResource
@NonExtendable
public interface JarResource
A resource found in a
JarContents.
NOTE: Instances of this class obtained from JarResourceVisitor should not be
copied for use outside the visitor. If you need to hold onto a resource outside the visitor, copy it first
using retain().
-
Method Summary
Modifier and TypeMethodDescriptionReads metadata attributes of this resource.default BufferedReaderdefault BufferedReaderbufferedReader(Charset charset) open()default byte[]retain()Create a copy of this jar resource reference that can be held onto.
-
Method Details
-
open
- Throws:
IOException
-
bufferedReader
- Throws:
IOException
-
bufferedReader
- Throws:
IOException
-
readAllBytes
- Throws:
IOException
-
attributes
Reads metadata attributes of this resource.- Returns:
- The attributes of this resource.
- Throws:
IOException- If accessing the attributes fails due to an I/O error.
-
retain
JarResource retain()Create a copy of this jar resource reference that can be held onto.Useful in the context of
JarResourceVisitor, where resource objects are reused between visits, and copies must be made to hold onto resources for later use.
-