diff --git a/src/main/java/nl/knaw/dans/dvingest/core/dansbag/domain/DepositFile.java b/src/main/java/nl/knaw/dans/dvingest/core/dansbag/domain/DepositFile.java index 0e13b38..2d5ca26 100644 --- a/src/main/java/nl/knaw/dans/dvingest/core/dansbag/domain/DepositFile.java +++ b/src/main/java/nl/knaw/dans/dvingest/core/dansbag/domain/DepositFile.java @@ -16,24 +16,16 @@ package nl.knaw.dans.dvingest.core.dansbag.domain; import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.Value; import org.w3c.dom.Node; import java.nio.file.Path; -@Data +@Value @AllArgsConstructor public class DepositFile { - private Path path; - private Path physicalPath; - private String checksum; - private Node xmlNode; - - public Path getPhysicalPath() { - if (this.physicalPath != null) { - return physicalPath; - } - - return path; - } + Path path; + Path physicalPath; + String checksum; + Node xmlNode; } diff --git a/src/main/java/nl/knaw/dans/dvingest/core/dansbag/domain/FileInfo.java b/src/main/java/nl/knaw/dans/dvingest/core/dansbag/domain/FileInfo.java index 6f5c108..9f9e173 100644 --- a/src/main/java/nl/knaw/dans/dvingest/core/dansbag/domain/FileInfo.java +++ b/src/main/java/nl/knaw/dans/dvingest/core/dansbag/domain/FileInfo.java @@ -16,20 +16,18 @@ package nl.knaw.dans.dvingest.core.dansbag.domain; import lombok.AllArgsConstructor; -import lombok.Data; import lombok.ToString; +import lombok.Value; import nl.knaw.dans.lib.dataverse.model.file.FileMeta; import java.nio.file.Path; -@Data +@Value @ToString @AllArgsConstructor public class FileInfo { - private Path path; - private Path physicalPath; - private String checksum; - private boolean sanitized; - private FileMeta metadata; - + Path path; + String checksum; + boolean sanitized; + FileMeta metadata; } diff --git a/src/main/java/nl/knaw/dans/dvingest/core/dansbag/mapper/mapping/FileElement.java b/src/main/java/nl/knaw/dans/dvingest/core/dansbag/mapper/mapping/FileElement.java index f126a82..56e2e91 100644 --- a/src/main/java/nl/knaw/dans/dvingest/core/dansbag/mapper/mapping/FileElement.java +++ b/src/main/java/nl/knaw/dans/dvingest/core/dansbag/mapper/mapping/FileElement.java @@ -45,7 +45,7 @@ public class FileElement extends Base { ); @Value - private static class FileMetaResult { + public static class FileMetaResult { boolean sanitized; FileMeta fileMeta; } @@ -226,7 +226,6 @@ public static Map pathToFileInfo(Deposit deposit, boolean isMigr var fileMetaResult = toFileMeta(depositFile.getXmlNode(), defaultRestrict, isMigration); result.put(depositFile.getPath(), new FileInfo( bagDir.resolve(depositFile.getPath()), - bagDir.resolve(depositFile.getPhysicalPath()), depositFile.getChecksum(), fileMetaResult.isSanitized(), fileMetaResult.getFileMeta()