code cleanup

This commit is contained in:
anhefti 2022-06-27 15:24:21 +02:00
parent 0cce03198c
commit fdcd98b988
2 changed files with 7 additions and 4 deletions

View file

@ -64,7 +64,10 @@ public class RAPConfiguration implements ApplicationConfiguration {
application.addResource("fav_icon", new ResourceLoader() {
@Override
public InputStream getResourceAsStream(final String resourceName) throws IOException {
return RAPConfiguration.class.getClassLoader().getResourceAsStream("static/images/fav_icon.png");
return Thread
.currentThread()
.getContextClassLoader()
.getResourceAsStream("static/images/fav_icon.png");
}
});

View file

@ -226,11 +226,11 @@ public class CertificateController {
.flatMap(certData -> this.userActivityLogDAO.log(UserLogActivityType.IMPORT, certData))
.getOrThrow();
} catch (final RuntimeException re) {
IOUtils.closeQuietly(inputStream);
throw re;
} catch (final Exception e) {
IOUtils.closeQuietly(inputStream);
if (e instanceof RuntimeException) {
throw (RuntimeException) e;
}
throw new RuntimeException(e);
}
}