parent
1984d2de11
commit
ff10c26332
|
@ -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<>();
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue