File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
src/main/java/org/sead/uploader/dataverse Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 4
4
<modelVersion >4.0.0</modelVersion >
5
5
<groupId >DVUploader</groupId >
6
6
<artifactId >DVUploader</artifactId >
7
- <version >1.2.0 </version >
7
+ <version >1.2.1 </version >
8
8
<properties >
9
9
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
10
10
</properties >
Original file line number Diff line number Diff line change @@ -329,7 +329,8 @@ public String itemExists(String path, Resource item) {
329
329
println ("out:" + relPath );
330
330
}
331
331
332
- String sourcepath = item .getName ();
332
+ //Create a path/name string w/o an initial /
333
+ String sourcepath = (path .length ()==1 ? "" : path .substring (1 )) + item .getName ();
333
334
334
335
// One-time: get metadata for dataset to see if it exists and what files it
335
336
// contains
@@ -440,9 +441,11 @@ public String itemExists(String path, Resource item) {
440
441
441
442
@ Override
442
443
protected String verifyDataByHash (String tagId , String path , Resource item ) {
443
- JSONObject checksum = existingItems .get (item .getName ());
444
+ String sourcepath = (path .startsWith ("/" ) ? "" : path ) + item .getName ();
445
+
446
+ JSONObject checksum = existingItems .get (sourcepath );
444
447
if (!checksum .getString ("value" ).equals (item .getHash (checksum .getString ("type" )))) {
445
- hashIssues .put (path + item . getName () , "!!!: A different version of this item exists with ID: " + tagId );
448
+ hashIssues .put (sourcepath , "!!!: A different version of this item exists with ID: " + tagId );
446
449
return null ;
447
450
} // else it matches!
448
451
return tagId ;
You can’t perform that action at this time.
0 commit comments