audittool/test-lib/src/main/java/io/bdrc/audit/audittests/EXIFTest.java
private void TestImages(final Path imageGroupParent) throws IOException {

            Integer outcome = outcomeMap.get(getTestName());

            DirectoryStream.Filter<Path> filter =
                    entry -> (entry.toFile().isFile()
                            && !(entry.toFile().isHidden()
                            || entry.toString().endsWith("json")));

            try (DirectoryStream<Path> imageFiles = Files.newDirectoryStream(imageGroupParent, filter)) {
                for (Path imageFile : imageFiles) {
                    File fileObject = imageFile.toAbsolutePath().toFile();
                    java.lang.String fileObjectPathString = imageFile.toAbsolutePath().toString();

                    try {
                        ImageEXIFAttributes exifAttrs = new ImageEXIFAttributes(fileObject);
                        List<ImageEXIFBead> invalidExifAttrs = validateEXIF(exifAttrs);
                        if (invalidExifAttrs.size() > 0) {
                            StringBuilder badTags = new StringBuilder();
                            invalidExifAttrs.forEach(x -> {
                                badTags.append(x.toString());
                                badTags.append(System.getProperty("line.separator"));
                            });
                            FailTest(outcome, fileObjectPathString, badTags.toString());
                        }
                        if (sysLogger.isDebugEnabled()) {
                            try {
//                            exifAttrs.DumpEXIFDirectories(fileObject);
                                exifAttrs.DumpCommonsMetadata(fileObject);
                            } catch (Exception someExc) {
                                sysLogger.error(String.valueOf(someExc));

                            }
                        }
                    }

                    catch (UnsupportedFormatException ufe) {
                        FailTest(outcome, fileObjectPathString);
                    }

                }
            }
            sysLogger.debug("Test outcome {} error count {}", getTestResult().getOutcome(),
                    getTestResult()
                            .getErrors().size());
            if (!IsTestFailed()) {
                PassTest();
            }
        }
/**
         * EXIF Image Testing.
         * Loop over images in an image group to
         * @param imageGroupParent folder containing imageGroups
         * @throws IOException If io error
         */
EXIF Image Testing.
Loop over images in an image group to
@param imageGroupParent folder containing imageGroups
@throws IOException If io error
EXIF Image Testing . Loop over images in an image group to @param imageGroupParent folder containing imageGroups @throws IOException If io error
private void TestImages(final Path imageGroupParent) throws IOException {
            Integer outcome = outcomeMap.get(getTestName());
            DirectoryStream.Filter<Path> filter =
                    entry -> (entry.toFile().isFile()
                            && !(entry.toFile().isHidden()
                            || entry.toString().endsWith("json")));
            try (DirectoryStream<Path> imageFiles = Files.newDirectoryStream(imageGroupParent, filter)) {
                for (Path imageFile : imageFiles) {
                    File fileObject = imageFile.toAbsolutePath().toFile();
                    java.lang.String fileObjectPathString = imageFile.toAbsolutePath().toString();
                    try {
                        ImageEXIFAttributes exifAttrs = new ImageEXIFAttributes(fileObject);
                        List<ImageEXIFBead> invalidExifAttrs = validateEXIF(exifAttrs);
                        if (invalidExifAttrs.size() > 0) {
                            StringBuilder badTags = new StringBuilder();
                            invalidExifAttrs.forEach(x -> {
                                badTags.append(x.toString());
                                badTags.append(System.getProperty("line.separator"));
                            });
                            FailTest(outcome, fileObjectPathString, badTags.toString());
                        }
                        if (sysLogger.isDebugEnabled()) {
                            try {
                                exifAttrs.DumpCommonsMetadata(fileObject);
                            } catch (Exception someExc) {
                                sysLogger.error(String.valueOf(someExc));
                            }
                        }
                    }
                    catch (UnsupportedFormatException ufe) {
                        FailTest(outcome, fileObjectPathString);
                    }
                }
            }
            sysLogger.debug("Test outcome {} error count {}", getTestResult().getOutcome(),
                    getTestResult()
                            .getErrors().size());
            if (!IsTestFailed()) {
                PassTest();
            }
        }
private void TestImages ( final Path imageGroupParent ) throws IOException { Integer outcome = outcomeMap . get ( getTestName ( ) ) ; DirectoryStream . Filter < Path > filter = entry -> ( entry . toFile ( ) . isFile ( ) && ! ( entry . toFile ( ) . isHidden ( ) || entry . toString ( ) . endsWith ( "json" ) ) ) ; try ( DirectoryStream < Path > imageFiles = Files . newDirectoryStream ( imageGroupParent , filter ) ) { for ( Path imageFile : imageFiles ) { File fileObject = imageFile . toAbsolutePath ( ) . toFile ( ) ; java . lang . String fileObjectPathString = imageFile . toAbsolutePath ( ) . toString ( ) ; try { ImageEXIFAttributes exifAttrs = new ImageEXIFAttributes ( fileObject ) ; List < ImageEXIFBead > invalidExifAttrs = validateEXIF ( exifAttrs ) ; if ( invalidExifAttrs . size ( ) > 0 ) { StringBuilder badTags = new StringBuilder ( ) ; invalidExifAttrs . forEach ( x -> { badTags . append ( x . toString ( ) ) ; badTags . append ( System . getProperty ( "line.separator" ) ) ; } ) ; FailTest ( outcome , fileObjectPathString , badTags . toString ( ) ) ; } if ( sysLogger . isDebugEnabled ( ) ) { try { exifAttrs . DumpCommonsMetadata ( fileObject ) ; } catch ( Exception someExc ) { sysLogger . error ( String . valueOf ( someExc ) ) ; } } } catch ( UnsupportedFormatException ufe ) { FailTest ( outcome , fileObjectPathString ) ; } } } sysLogger . debug ( "Test outcome {} error count {}" , getTestResult ( ) . getOutcome ( ) , getTestResult ( ) . getErrors ( ) . size ( ) ) ; if ( ! IsTestFailed ( ) ) { PassTest ( ) ; } }
EXIF Image Testing.
EXIF Image Testing .
//                            exifAttrs.DumpEXIFDirectories(fileObject);