Skip to content

Commit

Permalink
Merge pull request #95 from keeps/jgomes-dev
Browse files Browse the repository at this point in the history
Fixed bug in file Grups structure
  • Loading branch information
luis100 authored Mar 3, 2022
2 parents 8258db1 + 34b91a8 commit 4892aa6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ public static Map<String, FileGrp> getDataFileGrp() {
* {@link IPRepresentation}
*/
private static void addFileGrps(final IPRepresentation representation) {

for (IPFileInterface file : representation.getData()) {
final String dataFilePath;
if (file.getRelativeFolders() == null || file.getRelativeFolders().isEmpty()) {
Expand Down Expand Up @@ -890,4 +891,11 @@ private static void addDataFileFromShallow(List<FileGrpType> fileGrpTypes, IPFil
}
}

/**
* Clean the {@link HashMap} data.
*/
public static void cleanFileGrpStructure() {
dataFileGrp.clear();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ protected static void addRepresentationsToZipAndMETS(IPInterface ip, List<IPRepr
representationMETSWrapper, IPConstants.REPRESENTATIONS_FOLDER + representationId
+ IPConstants.ZIP_PATH_SEPARATOR + IPConstants.METS_FILE,
buildDir);

EARKMETSUtils.cleanFileGrpStructure();
}
if (ip instanceof SIP) {
((SIP) ip).notifySipBuildRepresentationsProcessingEnded();
Expand Down Expand Up @@ -235,7 +237,7 @@ protected static void addRepresentationDataFilesToZipAndMETS(IPInterface ip, Map
ZIPUtils.addFileTypeFileToZip(zipEntries, file.getPath(), dataFilePath, fileType);
} else if (file instanceof IPFileShallow) {
IPFileShallow shallow = (IPFileShallow) file;
if(shallow.getFileLocation() != null) {
if (shallow.getFileLocation() != null) {
EARKMETSUtils.addDataFileToMETS(representationMETSWrapper, shallow);
}
}
Expand Down

0 comments on commit 4892aa6

Please sign in to comment.