开发者

Removing URL from a URL classloader

开发者 https://www.devze.com 2022-12-28 08:58 出处:网络
Is there any way to remove the URL from a URLClassloader? If suppose w开发者_C百科e removed the URL from classloader what all possible problems can happen?

Is there any way to remove the URL from a URLClassloader?

If suppose w开发者_C百科e removed the URL from classloader what all possible problems can happen?


Is there any way to remove the URL from a URLClassloader?

AFAIK, no.

If suppose we removed the URL from classloader what all possible problems can happen?

Well, for a start it can break code that relies on being able to dynamically load classes and resources. It is also possible this kind of thing could be used to break security sandboxes.

Why are you considering doing this?


Is there any way to remove the URL from a URLClassloader?

No.

If suppose we removed the URL from classloader what all possible problems can happen?

As you can't the question is pointless.


You could use URLs with URLStreamHandlers which shutdown, if you were desperate. That may not affect load classes and resources from already open Jar files.

I don't see a particular problem with this. Unlike addURL where a class may not be on the set of URLs when first asked for, and cannot be subsequently added.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号