Instances of this interface must be closed when no longer used. Closing it will allow classpath managers to reload the underlying classpath files.
public void | close() Closes this stream and releases any system resources associated
with it. |
public ClassLoaderDataFinder | Gets a classloader data finder for the loaded classpath. |
public Path | Gets the directory where the classpath was actually loaded. |
public Path | Gets the path to the loaded classpath. |
public String | Gets the location identifier which was returned by the corresponding ClassPathLocation. |
public Object | Gets a version object representation of the loaded classpath. |
As noted in AutoCloseable.close(), cases where the
close may fail require careful attention. It is strongly advised
to relinquish the underlying resources and to internally
mark the Closeable
as closed, prior to throwing
the IOException
.
Classloader data finders can be used to construct a classloader. See MultiDataClassLoader.
The returned path is either a path to a JAR file, or a directory containing class files in the respective package hierarchy.
Version objects can be compared by equality to check if the classpath was reloaded between different lock retrievals. Clients can be sure that if two version objects equal, then the associated classpaths to the version objects contain the same files.
Note, that even if the compared versions equal, the associated class loader data finder may have been reloaded meanwhile. This means that if you plan on reusing the class loaders based on the associated class loader data finder, then you need to ensure that always the most recent class loader data finder is used by your classloader.