Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2022-01-10 10:57:04 +01:00
commit 7ceb2d0c21
No known key found for this signature in database
GPG Key ID: 1677D141BCF3584D
3 changed files with 15 additions and 3 deletions

View File

@ -16,6 +16,7 @@ package org.eclipse.jetty.security;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -218,7 +219,10 @@ public class PropertyUserStore extends UserStore implements PathWatcher.Listener
throw new IllegalStateException("Config does not exist: " + config);
Properties properties = new Properties();
properties.load(config.getInputStream());
try (InputStream inputStream = config.getInputStream())
{
properties.load(inputStream);
}
Set<String> known = new HashSet<>();

View File

@ -70,7 +70,10 @@ public class Modules implements Iterable<Module>
Path deprecatedPath = _baseHome.getPath("modules/deprecated.properties");
if (deprecatedPath != null && FS.exists(deprecatedPath))
{
_deprecated.load(new FileInputStream(deprecatedPath.toFile()));
try (FileInputStream inputStream = new FileInputStream(deprecatedPath.toFile()))
{
_deprecated.load(inputStream);
}
}
}
catch (IOException e)

View File

@ -1823,7 +1823,12 @@ public class XmlConfiguration
properties.put(arg.substring(0, i), arg.substring(i + 1));
}
else if (arg.toLowerCase(Locale.ENGLISH).endsWith(".properties"))
properties.load(Resource.newResource(arg).getInputStream());
{
try (InputStream inputStream = Resource.newResource(arg).getInputStream())
{
properties.load(inputStream);
}
}
}
// For all arguments, parse XMLs