Skip to content

Commit

Permalink
add zipfile manifest note(s) for embargoed file(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers committed Oct 19, 2021
1 parent 0ac7d9d commit 15ebc4a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/main/java/edu/harvard/iq/dataverse/api/Access.java
Original file line number Diff line number Diff line change
Expand Up @@ -888,14 +888,21 @@ public void write(OutputStream os) throws IOException,

zipper.addToManifest(fileName + " (" + mimeType + ") " + " skipped because the total size of the download bundle exceeded the limit of " + zipDownloadSizeLimit + " bytes.\r\n");
}
} else if(file.isRestricted()) {
if (zipper == null) {
fileManifest = fileManifest + file.getFileMetadata().getLabel() + " IS RESTRICTED AND CANNOT BE DOWNLOADED\r\n";
} else {
boolean embargoed = FileUtil.isActivelyEmbargoed(file);
if (file.isRestricted() || embargoed) {
if (zipper == null) {
fileManifest = fileManifest + file.getFileMetadata().getLabel() + " IS "
+ (embargoed ? "EMBARGOED" : "RESTRICTED")
+ " AND CANNOT BE DOWNLOADED\r\n";
} else {
zipper.addToManifest(file.getFileMetadata().getLabel() + " IS "
+ (embargoed ? "EMBARGOED" : "RESTRICTED")
+ " AND CANNOT BE DOWNLOADED\r\n");
}
} else {
zipper.addToManifest(file.getFileMetadata().getLabel() + " IS RESTRICTED AND CANNOT BE DOWNLOADED\r\n");
fileId = null;
}
} else {
fileId = null;
}

} if (null == fileId) {
Expand Down

0 comments on commit 15ebc4a

Please sign in to comment.