Class JarLibrary
java.lang.Object
io.papermc.paper.plugin.loader.library.impl.JarLibrary
- All Implemented Interfaces:
ClassPathLibrary
A simple jar library implementation of the
ClassPathLibrary
that allows PluginLoader
s to
append a jar stored on the local file system into their runtime classloader.
An example creation of the jar library type may look like this:
final JarLibrary customLibrary = new JarLibrary(Path.of("libs/custom-library-1.24.jar"));
resulting in a jar library that provides the jar at libs/custom-library-1.24.jar
to the plugins classloader
at runtime.
The jar library implementation will error if the file does not exist at the specified path.
-
Constructor Summary
ConstructorDescriptionJarLibrary
(@NotNull Path path) Creates a new jar library that references the jar file found at the provided path. -
Method Summary
Modifier and TypeMethodDescriptionvoid
register
(@NotNull LibraryStore store) Called to register the library this class path library represents into the passed library store.
-
Constructor Details
-
JarLibrary
Creates a new jar library that references the jar file found at the provided path.- Parameters:
path
- the path, relative to the JVMs start directory.
-
-
Method Details
-
register
Description copied from interface:ClassPathLibrary
Called to register the library this class path library represents into the passed library store. This method may either be implemented by the plugins themselves if they need complex logic, or existing API exposed implementations of this interface may be used.- Specified by:
register
in interfaceClassPathLibrary
- Parameters:
store
- the library store instance to register this library into- Throws:
LibraryLoadingException
- if library loading failed for this classpath library
-