@@ -0,0 +1,2858 @@
+%0Apackage info.freelibrary.jiiify.util;%0A%0Aimport java.awt.Dimension;%0Aimport java.io.File;%0Aimport java.io.FileReader;%0Aimport java.io.FileWriter;%0Aimport java.io.IOException;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport info.freelibrary.jiiify.iiif.IIIFException;%0Aimport info.freelibrary.jiiify.iiif.ImageRequest;%0Aimport info.freelibrary.util.PairtreeRoot;%0A%0Aimport au.com.bytecode.opencsv.CSVReader;%0Aimport au.com.bytecode.opencsv.CSVWriter;%0A%0Apublic class ReportUtils %7B%0A%0A    private static final File CSV_FILE = new File(%22input.csv%22);%0A%0A    private static final File CSV_OUT = new File(%22output.csv%22);%0A%0A    private static final Logger LOGGER = LoggerFactory.getLogger(ReportUtils.class);%0A%0A    private static int myFoundCount;%0A%0A    private static int myNotFoundCount;%0A%0A    public static final void main(final String%5B%5D args) throws IOException %7B%0A        final CSVReader csvReader = new CSVReader(new FileReader(CSV_FILE));%0A        final PairtreeRoot ptRoot = new PairtreeRoot(new File(args%5B0%5D));%0A        final CSVWriter csvWriter = new CSVWriter(new FileWriter(CSV_OUT));%0A%0A        csvReader.readAll().forEach(image -%3E %7B%0A            try %7B%0A                final File imageFile = new File(image%5B1%5D);%0A                final Dimension dim = ImageUtils.getImageDimension(imageFile);%0A%0A                myFoundCount = 0;%0A                myNotFoundCount = 0;%0A%0A                ImageUtils.getTilePaths(%22/iiif%22, image%5B0%5D, 1024, dim.width, dim.height).forEach(path -%3E %7B%0A                    try %7B%0A                        final ImageRequest request = new ImageRequest(path);%0A%0A                        if (request.hasCachedFile(ptRoot)) %7B%0A                            myFoundCount++;%0A                        %7D else %7B%0A                            myNotFoundCount++;%0A                        %7D%0A                    %7D catch (final IIIFException %7C IOException details) %7B%0A                        try %7B%0A                            csvWriter.close();%0A                            csvReader.close();%0A                        %7D catch (final IOException ignorable) %7B%0A                            LOGGER.error(ignorable.getMessage(), ignorable);%0A                        %7D%0A%0A                        throw new RuntimeException(details);%0A                    %7D%0A                %7D);%0A%0A                csvWriter.writeNext(new String%5B%5D %7B imageFile.getAbsolutePath(), Integer.toString(myFoundCount),%0A                    Integer.toString(myNotFoundCount) %7D);%0A            %7D catch (final IOException details) %7B%0A                try %7B%0A                    csvWriter.close();%0A                    csvReader.close();%0A                %7D catch (final IOException ignorable) %7B%0A                    LOGGER.error(ignorable.getMessage(), ignorable);%0A                %7D%0A%0A                throw new RuntimeException(details);%0A            %7D%0A        %7D);%0A%0A        csvReader.close();%0A        csvWriter.close();%0A    %7D%0A%7D%0A

Add csv pairtree file system checker script