Не понимаю как работает вот эта строчка:
containsContent = new String(Files.readAllBytes(file)).contains(partOfContent);