buda-base / asset-manager

Asset Manager and audit tool
The Unlicense
0 stars 0 forks source link

File name format test fails some legitimate file names #184

Closed jimk-bdrc closed 1 year ago

jimk-bdrc commented 1 year ago

Describe the bug Given an image group W22271-0760 the file W22271-0762/07620762.tif fails

To Reproduce

mkdir -p W22271/images
cp  $(locate_archive /mnt/Archive W22271/images/W22271-0762 W22271/images
audit-tool -TImageFileNameFormat W22271

Data cp $(locate_archive /mnt/Archive W22271/images/W22271-0762 W22271/images

Expected behavior all files should pass

The offending LOC is ImageFileNameFormatTest.java, 155 String restOfFileName = FilenameUtils.getBaseName(StringUtils.remove(imageFileName,targetIgName));

StringUtils.remove removes both instances of the string 0762 when it should only remove the first one.