@@ -147,7 +147,7 @@ public BundleDownloadInstance datafileBundle(@Context ContainerRequestContext cr
147147 checkAuthorization (crc , df );
148148 User requestor = getRequestor (crc );
149149 if (checkGuestbookRequiredResponse (crc , uriInfo , df , gbrids )) {
150- throw new BadRequestException (BundleUtil .getStringFromBundle ("access.api.download.failure.guestbookResponseMissing" ));
150+ throw new BadRequestException (BundleUtil .getStringFromBundle ("access.api.download.failure.guestbookResponseMissing" , getGuestbookIdFromDatafile ( df ) ));
151151 }
152152
153153 if (gbrecs != true && df .isReleased ()) {
@@ -252,7 +252,7 @@ public Response datafile(@Context ContainerRequestContext crc, @PathParam("fileI
252252 checkAuthorization (crc , df );
253253 User requestor = getRequestor (crc );
254254 if (checkGuestbookRequiredResponse (crc , uriInfo , df , gbrids )) {
255- return error (BAD_REQUEST , BundleUtil .getStringFromBundle ("access.api.download.failure.guestbookResponseMissing" ));
255+ return error (BAD_REQUEST , BundleUtil .getStringFromBundle ("access.api.download.failure.guestbookResponseMissing" , getGuestbookIdFromDatafile ( df ) ));
256256 }
257257
258258 if (gbrecs != true && df .isReleased ()){
@@ -407,6 +407,11 @@ private String normalizeFileId(String fileId) {
407407 return fId ;
408408 }
409409
410+ // for bundle arg list
411+ private List <String > getGuestbookIdFromDatafile (DataFile df ) {
412+ return df != null && df .getOwner () != null && df .getOwner ().getGuestbook () != null ? List .of (df .getOwner ().getGuestbook ().getId ().toString ()) : List .of ();
413+ }
414+
410415 // Process the guestbook response from JSON and return a signedUrl to the matching GET call
411416 private Response processDatafileWithGuestbookResponse (ContainerRequestContext crc , HttpHeaders headers , String fileIds , UriInfo uriInfo , boolean gbrecs , String jsonBody ) {
412417
@@ -435,7 +440,7 @@ private Response processDatafileWithGuestbookResponse(ContainerRequestContext cr
435440 MakeDataCountEntry entry = new MakeDataCountEntry (uriInfo , headers , dvRequestService , df );
436441 mdcLogService .logEntry (entry );
437442 } else {
438- return error (BAD_REQUEST , BundleUtil .getStringFromBundle ("access.api.download.failure.guestbookResponseMissing" ));
443+ return error (BAD_REQUEST , BundleUtil .getStringFromBundle ("access.api.download.failure.guestbookResponseMissing" , getGuestbookIdFromDatafile ( df ) ));
439444 }
440445 } else if (gbrecs != true && df .isReleased ()) {
441446 // Write Guestbook record if not done previously and file is released
@@ -1031,7 +1036,7 @@ private Response downloadDatafiles(ContainerRequestContext crc, String body, boo
10311036 MakeDataCountEntry entry = new MakeDataCountEntry (uriInfo , headers , dvRequestService , df );
10321037 mdcLogService .logEntry (entry );
10331038 } else {
1034- return error (BAD_REQUEST , BundleUtil .getStringFromBundle ("access.api.download.failure.guestbookResponseMissing" ));
1039+ return error (BAD_REQUEST , BundleUtil .getStringFromBundle ("access.api.download.failure.guestbookResponseMissing" , getGuestbookIdFromDatafile ( df ) ));
10351040 }
10361041 } catch (JsonParseException | CommandException ex ) {
10371042 List <String > args = Arrays .asList (df .getDisplayName (), ex .getLocalizedMessage ());
0 commit comments