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() { application.addResource("fav_icon", new ResourceLoader() {
@Override @Override
public InputStream getResourceAsStream(final String resourceName) throws IOException { 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)) .flatMap(certData -> this.userActivityLogDAO.log(UserLogActivityType.IMPORT, certData))
.getOrThrow(); .getOrThrow();
} catch (final RuntimeException re) {
IOUtils.closeQuietly(inputStream);
throw re;
} catch (final Exception e) { } catch (final Exception e) {
IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(inputStream);
if (e instanceof RuntimeException) {
throw (RuntimeException) e;
}
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }