Skip to content

Commit

Permalink
Merge TRDS
Browse files Browse the repository at this point in the history
Conflicts:
	nbactions.xml
	src/main/java/org/sead/uploader/dataverse/DVUploader.java
  • Loading branch information
qqmyers committed Jan 8, 2020
2 parents b3284cc + 5cc0312 commit f792b6e
Show file tree
Hide file tree
Showing 11 changed files with 3,657 additions and 3,614 deletions.
87 changes: 65 additions & 22 deletions nbactions.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>build</actionName>
<packagings>
<packaging>*</packaging>
</packagings>
<goals>
<goal>compile</goal>
<goal>assembly:single</goal>
</goals>
</action>
<action>
<actionName>rebuild</actionName>
<packagings>
<packaging>*</packaging>
</packagings>
<goals>
<goal>clean</goal>
<goal>compile</goal>
<goal>assembly:single</goal>
</goals>
</action>
</actions>
<action>
<actionName>build</actionName>
<packagings>
<packaging>*</packaging>
</packagings>
<goals>
<goal>compile</goal>
<goal>assembly:single</goal>
</goals>
</action>
<action>
<actionName>rebuild</actionName>
<packagings>
<packaging>*</packaging>
</packagings>
<goals>
<goal>clean</goal>
<goal>compile</goal>
<goal>assembly:single</goal>
</goals>
</action>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath ${packageClassName} -server=https://sead2-dev.ncsa.illinois.edu -key=523caf58-b444-46ef-bc38-633e6846d5ca -skip=4 dummytree</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
</goals>
<properties>
<exec.args>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath ${packageClassName} -server=https://sead2-dev.ncsa.illinois.edu -key=523caf58-b444-46ef-bc38-633e6846d5ca -skip=4 dummytree</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath ${packageClassName} -server=https://sead2-dev.ncsa.illinois.edu -key=523caf58-b444-46ef-bc38-633e6846d5ca -skip=4 dummytree</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>
14 changes: 7 additions & 7 deletions src/main/java/org/sead/uploader/AbstractUploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,18 @@ public void parseArgs(String[] args) {
public abstract HttpClientContext authenticate();

public void processRequests() {
if(importRO && (skip>0 || max < Long.MAX_VALUE)) {
if (importRO && (skip > 0 || max < Long.MAX_VALUE)) {
println("Cannot set max or skip limits when importing an existing RO");
System.exit(0);
}
//Avoid max+skip > Long.MAX_VALUE
max=((Long.MAX_VALUE-max) -skip) <0 ? (max-skip): max;
max = ((Long.MAX_VALUE - max) - skip) < 0 ? (max - skip) : max;
localContext = authenticate();
if (localContext == null) {
println("Authentication failure - exiting.");
System.exit(0);
}
if(skip>0) {
if (skip > 0) {
println("WILL SKIP " + skip + " FILES");
}
try {
Expand Down Expand Up @@ -202,7 +202,7 @@ public void processRequests() {
println("CURRENT TOTAL: " + globalFileCount + " files :" + totalBytes + " bytes");
} else if ((tagId == null) && (!listonly)) {
println("Not uploaded due to error during processing: " + file.getPath());
}
}
} else {
println("SKIPPING(F): " + file.getPath());
skip--;
Expand Down Expand Up @@ -361,11 +361,11 @@ protected String uploadCollection(Resource dir, String path, String parentId, St
totalBytes += file.length();
println(" UPLOADED as: " + newUri);
println("CURRENT TOTAL: " + globalFileCount + " files :" + totalBytes + " bytes");
}
}
} else {
println("SKIPPING(F): " + file.getPath());
skip = skip - 1;
if(skip==0l) {
if (skip == 0l) {
println("\nSKIP COMPLETE");
}
}
Expand Down Expand Up @@ -443,7 +443,7 @@ public String uploadDatafile(Resource file, String path, String dataId) {
if (!listonly) {
if (dataId == null) { // doesn't exist or we don't care (!merge)
try {
dataId = uploadDatafile(file, path);
dataId = uploadDatafile(file, path);
} catch (UploaderException ue) {
println(ue.getMessage());
}
Expand Down
Loading

0 comments on commit f792b6e

Please sign in to comment.