/** * Frees the {@link Archive} for given root. * @param root the root for which the {@link Archive} should be freed. */ public synchronized void removeArchive (@NonNull final URL root) { final URI rootURI = toURI(root); final Archive archive = archives.remove(rootURI); for (Iterator<Map.Entry<URI,URI>> it = ctSymToJar.entrySet().iterator(); it.hasNext();) { final Map.Entry<URI,URI> e = it.next(); if (e.getValue().equals(rootURI)) { it.remove(); break; } } if (archive != null) { archive.clear(); } }
/** * Maps ct.sym back to the base boot classpath root. * @param archiveOrCtSym the root or ct.sym folder to transform. * @return the boot classpath root corresponding to the ct.sym folder * or the given boot classpath root. */ @NonNull public synchronized URL mapCtSymToJar (@NonNull final URL archiveOrCtSym) { final URI result = ctSymToJar.get(toURI(archiveOrCtSym)); if (result != null) { try { return result.toURL(); } catch (MalformedURLException ex) { Exceptions.printStackTrace(ex); } } return archiveOrCtSym; }
/** * Clears the in memory cached {@link Archive} data for given root. * @param root the root for which the {@link Archive} data should be cleared. * @see Archive#clear() */ public synchronized void clearArchive (@NonNull final URL root) { Archive archive = archives.get(toURI(root)); if (archive != null) { archive.clear(); } }
final URI rootURI = toURI(root); Archive archive;
URI uriInCtSym; try { uriInCtSym = toURI(resolved); } catch (IllegalArgumentException e) { uriInCtSym = null;