Skip to content

Commit

Permalink
revert incorrect changes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Nov 2, 2023
1 parent e2ca634 commit 285098e
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,7 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
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;
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,14 @@ public String getSha256() {
public void setSha256(Object s) {
if (s instanceof String)
sha256 = (String) s;

}

@Override
/**
* {@inheritDoc}
*/
public String getSource() {
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;
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,7 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
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;
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,7 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
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;
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,7 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
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;
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,7 @@ public void setSha256(Object s) {
* {@inheritDoc}
*/
public String getSource() {
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;
return source;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public interface WeightFormat {
public String getSha256();

/**
* REturn URL to the weights in the local machine
* @return URL to the weights in the local machine
* REturn the String defined in the Bioimage.io rdf.yaml file as the weigths source
* @return the String defined in the Bioimage.io rdf.yaml file as the weigths source
*/
public String getSource();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ private void unzipTfWeights() throws IOException {
* @throws MalformedURLException if the String does not correspond to an URL
*/
public static String getFileNameFromURLString(String str) throws MalformedURLException {
if (str.startsWith(Constants.ZENODO_DOMAIN))
if (str.startsWith(Constants.ZENODO_DOMAIN) && str.endsWith(Constants.ZENODO_ANNOYING_SUFFIX))
str = str.substring(0, str.length() - Constants.ZENODO_ANNOYING_SUFFIX.length());
URL url = new URL(str);
return new File(url.getPath()).getName();
Expand Down

0 comments on commit 285098e

Please sign in to comment.