Skip to content

Commit

Permalink
deal with new zenodo api
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 31, 2023
1 parent 290e5f7 commit e2ca634
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
return source;
if (source != null &&
source.startsWith(Constants.ZENODO_DOMAIN)
&& source.endsWith(Constants.ZENODO_ANNOYING_SUFFIX))
return source.substring(0,
source.length() - Constants.ZENODO_ANNOYING_SUFFIX.length());
else
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
return source;
if (source != null &&
source.startsWith(Constants.ZENODO_DOMAIN)
&& source.endsWith(Constants.ZENODO_ANNOYING_SUFFIX))
return source.substring(0,
source.length() - Constants.ZENODO_ANNOYING_SUFFIX.length());
else
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
return source;
if (source != null &&
source.startsWith(Constants.ZENODO_DOMAIN)
&& source.endsWith(Constants.ZENODO_ANNOYING_SUFFIX))
return source.substring(0,
source.length() - Constants.ZENODO_ANNOYING_SUFFIX.length());
else
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.Map;
import java.util.Set;

import io.bioimage.modelrunner.utils.Constants;
import io.bioimage.modelrunner.versionmanagement.SupportedVersions;

/**
Expand Down Expand Up @@ -173,7 +174,13 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
return source;
if (source != null &&
source.startsWith(Constants.ZENODO_DOMAIN)
&& source.endsWith(Constants.ZENODO_ANNOYING_SUFFIX))
return source.substring(0,
source.length() - Constants.ZENODO_ANNOYING_SUFFIX.length());
else
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,13 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
return source;
if (source != null &&
source.startsWith(Constants.ZENODO_DOMAIN)
&& source.endsWith(Constants.ZENODO_ANNOYING_SUFFIX))
return source.substring(0,
source.length() - Constants.ZENODO_ANNOYING_SUFFIX.length());
else
return source;
}

/**
Expand Down

0 comments on commit e2ca634

Please sign in to comment.