Skip to content

Commit 565cdfc

Browse files
committed
Avoid sending empty objects when the limit flag is used
and not all files in the dir are processed. FWIW - the empty objects were being sent to Dataverse and ignored, so the only real effect (aside from inefficiency) appears to be an incorrect count from line 603 when using limit (and may be skip?)
1 parent 8a5bba1 commit 565cdfc

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

perma-danspidfk212v2.0 - Copy.zip

5.66 KB
Binary file not shown.

perma-danspidfk212v2.0.zip

5.66 KB
Binary file not shown.

src/main/java/org/sead/uploader/dataverse/DVUploader.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,10 @@ protected void postProcessChildren(Resource dir) {
567567
for (Resource file : dir.listResources()) {
568568
if (!file.isDirectory()) {
569569
//println("Adding " + file.getName() + " to list: " + file.getMetadata().toString(2));
570-
571-
jsonData.put(file.getMetadata());
570+
JSONObject fileMetadata = file.getMetadata();
571+
if(!fileMetadata.isEmpty()) {
572+
jsonData.put(file.getMetadata());
573+
}
572574
}
573575
}
574576
meb.addTextBody("jsonData", jsonData.toString());

0 commit comments

Comments
 (0)