Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directoryLabel (file path) missing from getDatasetFileDetails from ExportDataProvider #10523

Open
pdurbin opened this issue Apr 23, 2024 · 0 comments
Labels
Size: 0.5 A percentage of a sprint. 0.35 hours

Comments

@pdurbin
Copy link
Member

pdurbin commented Apr 23, 2024

While working on Croissant support (#10341) I noticed that the getDatasetFileDetails method of ExportDataProvider doesn't provide the directoryLabel (file path) for files.

(As a workaround, you can get this information from getDatasetORE or getDatasetJson.)

I believe we just need to add one line, like this:

diff --git a/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java b/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java
index 38dab63384..baff29d2a5 100644
--- a/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java
+++ b/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java
@@ -729,60 +729,61 @@ public class JsonPrinter {
     public static JsonObjectBuilder json(DataFile df, FileMetadata fileMetadata, boolean forExportDataProvider, boolean returnOwners) {
...
         NullSafeJsonBuilder builder = jsonObjectBuilder()
                 .add("id", df.getId())
                 .add("persistentId", pidString)
                 .add("pidURL", pidURL)
                 .add("filename", fileName)
+                .add("directoryLabel", fileMetadata.getDirectoryLabel())
                 .add("contentType", df.getContentType())
                 .add("friendlyType", df.getFriendlyType())
@pdurbin pdurbin added the Size: 0.5 A percentage of a sprint. 0.35 hours label Apr 23, 2024
pdurbin added a commit to gdcc/dataverse-exporters that referenced this issue Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 0.5 A percentage of a sprint. 0.35 hours
Projects
None yet
Development

No branches or pull requests

1 participant