I have thousands of markdown templates files mixed in with markdown files that have actual content. The following python snippet checks each of the markdown files files that match all of the following conditions. If true, I know that it's a template, which gets moved into a templates folder in the same directory.
I have been asked to convert this code over to fit into some existing java code, is there a java equivalent for python's all()
or do I need to take a different direction. I am not that familiar with java and my searches have not turned up anything but the startswith() function in the apache.commons.
for i, fpath in enumerate(md_list):
with open(fpath) as f:
result = all(line.startswith('#') or line.startswith('[') or
line.startswith('|') or line.startswith('(') or
line.isspace() for line in f);
if result is True: do something