fix mounting/unmounting lifecycle of TLD resources

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2022-07-27 10:49:47 +02:00
parent 1cb80cf4ca
commit b1d5f908a6
2 changed files with 10 additions and 4 deletions

View File

@ -720,8 +720,11 @@ public class MetaInfConfiguration extends AbstractConfiguration
public Collection<URL> getTlds(URI uri) throws IOException
{
HashSet<URL> tlds = new HashSet<>();
try (Resource.Mount mount = Resource.mount(uriJarPrefix(uri, "!/"));
Stream<Path> stream = Files.walk(mount.root().getPath()))
Resource.Mount mount = Resource.mount(uriJarPrefix(uri, "!/"));
if (_mountedResources == null)
_mountedResources = new ArrayList<>();
_mountedResources.add(mount);
try (Stream<Path> stream = Files.walk(mount.root().getPath()))
{
Iterator<Path> it = stream
.filter(MetaInfConfiguration::isTldFile)

View File

@ -713,8 +713,11 @@ public class MetaInfConfiguration extends AbstractConfiguration
public Collection<URL> getTlds(URI uri) throws IOException
{
HashSet<URL> tlds = new HashSet<>();
try (Resource.Mount mount = Resource.mount(uriJarPrefix(uri, "!/"));
Stream<Path> stream = Files.walk(mount.root().getPath()))
Resource.Mount mount = Resource.mount(uriJarPrefix(uri, "!/"));
if (_mountedResources == null)
_mountedResources = new ArrayList<>();
_mountedResources.add(mount);
try (Stream<Path> stream = Files.walk(mount.root().getPath()))
{
Iterator<Path> it = stream
.filter(MetaInfConfiguration::isTldFile)