Java file API with Streams, Resources, NIO and old File is really complicated to make it right. You normally first have to look on Stackoverflow to get it right.
I would love to see some rules flagging overcomplicated usage of API:
byte foo = Files.readAllBytes(new File(this.getClass().getClassLoader().getResource("foo.txt").getFile()).toPath());
byte foo = this.getClass().getClassLoader().getResourceAsStream("foo.txt").readAllBytes();
I fear there is a long list of possible bad usages.