urlclassloader-util

Utilities for manipulating sun.misc.URLClassPath-based ClassLoaders

Лицензия

Лицензия

Группа

Группа

org.danilopianini
Идентификатор

Идентификатор

urlclassloader-util
Последняя версия

Последняя версия

0.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

urlclassloader-util
Utilities for manipulating sun.misc.URLClassPath-based ClassLoaders
Ссылка на сайт

Ссылка на сайт

https://github.com/DanySK/urlclassloader-util
Система контроля версий

Система контроля версий

https://github.com/DanySK/urlclassloader-util

Скачать urlclassloader-util

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.danilopianini/urlclassloader-util/ -->
<dependency>
    <groupId>org.danilopianini</groupId>
    <artifactId>urlclassloader-util</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.danilopianini/urlclassloader-util/
implementation 'org.danilopianini:urlclassloader-util:0.1.1'
// https://jarcasting.com/artifacts/org.danilopianini/urlclassloader-util/
implementation ("org.danilopianini:urlclassloader-util:0.1.1")
'org.danilopianini:urlclassloader-util:jar:0.1.1'
<dependency org="org.danilopianini" name="urlclassloader-util" rev="0.1.1">
  <artifact name="urlclassloader-util" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.danilopianini', module='urlclassloader-util', version='0.1.1')
)
libraryDependencies += "org.danilopianini" % "urlclassloader-util" % "0.1.1"
[org.danilopianini/urlclassloader-util "0.1.1"]

Зависимости

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
commons-io : commons-io jar 2.5

Модули Проекта

Данный проект не имеет модулей.

URLClassLoader util

Utilities for manipulating sun.misc.URLClassLoaders

Status

Stable branch

Build Status

Development branch

Build Status

Usage

You can add and remove entries for the classloader of your preference. Entries must be java.net.URLs (or java.net.URIs, or java.io.Files, or java.lang.Strings that can be transformed to URLs). The ClassLoader must have a field of type URLClassPath, that is what this library actually manipulates.

Please be wary that, despite being designed with some degree of reliability in mind, this library accesses non-public APIs, and as such may work only on a subset of Java Runtime Environments, and newer versions of working JREs may break it. The library is tested against multiple JREs, please refer to the Travis CI build to verify that the JRE you are interested in is currently supported.

Example with system ClassLoader

// Also URL, URI, or File are ok
final String myDir = ...;
URLClassLoaderUtil.addFirst(myDir);
URLClassLoaderUtil.remove(myDir);
URLClassLoaderUtil.addLast(myDir);

Example with the current class ClassLoader

final ClassLoader cl = MyClass.class.getClassLoader();
// Also URL, URI, or File are ok
final String myDir = ...;
URLClassLoaderUtil.addFirst(myDir, cl);
URLClassLoaderUtil.remove(myDir, cl);
URLClassLoaderUtil.addLast(myDir, cl);

Import URLClassLoader util in your project

I warmly suggest to use Gradle, Maven or a similar system to deal with dependencies within your project. In this case, you can use this product by importing the following Maven dependency:

<dependency>
    <groupId>org.danilopianini</groupId>
    <artifactId>urlclassloader-util</artifactId>
    <version>VERSION_YOU_WANT_TO_USE</version>
</dependency>

or the following Gradle dependency:

compile 'org.danilopianini:urlclassloader-util:VERSION_YOU_WANT_TO_USE'

Alternatively, you can grab the latest jar and throw it in your classpath. In this case, be sure to include the dependencies of this project in your classpath as well.

Версии библиотеки

Версия
0.1.1
0.1.0