Merge pull request #319 from nsacyber/rim-update-error

[#318] RIM upload error
This commit is contained in:
iadgovuser26 2020-11-23 13:05:41 -05:00 committed by GitHub
commit e3b8ce25d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,7 +188,7 @@ public class ReferenceManifestPageController
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
PageMessages messages = new PageMessages(); PageMessages messages = new PageMessages();
String fileName; String fileName;
Pattern pattern; Pattern logPattern = Pattern.compile(LOG_FILE_PATTERN);
Matcher matcher; Matcher matcher;
boolean supportRIM = false; boolean supportRIM = false;
BaseReferenceManifest base; BaseReferenceManifest base;
@ -197,13 +197,14 @@ public class ReferenceManifestPageController
// loop through the files // loop through the files
for (MultipartFile file : files) { for (MultipartFile file : files) {
fileName = file.getOriginalFilename(); fileName = file.getOriginalFilename();
pattern = Pattern.compile(LOG_FILE_PATTERN); matcher = logPattern.matcher(fileName);
matcher = pattern.matcher(fileName);
supportRIM = matcher.matches(); supportRIM = matcher.matches();
//Parse reference manifests //Parse reference manifests
ReferenceManifest rim = parseRIM(file, supportRIM, messages); ReferenceManifest rim = parseRIM(file, supportRIM, messages);
//Store only if it was parsed
if (rim != null) {
if (supportRIM) { if (supportRIM) {
// look for associated base/support // look for associated base/support
Set<BaseReferenceManifest> rims = BaseReferenceManifest Set<BaseReferenceManifest> rims = BaseReferenceManifest
@ -253,8 +254,6 @@ public class ReferenceManifestPageController
} }
} }
//Store only if it was parsed
if (rim != null) {
storeManifest(file.getOriginalFilename(), storeManifest(file.getOriginalFilename(),
messages, messages,
rim, rim,