Skip to content

Commit b86d92a

Browse files
committed
Remove erroneous exceptions from Scop
1 parent e2c57ed commit b86d92a

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

biojava3-structure/src/main/java/org/biojava/bio/structure/scop/ScopInstallation.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ protected void downloadClaFile() throws FileNotFoundException, IOException{
701701
if(mirrors.size()<1) {
702702
initScopURLs();
703703
}
704+
IOException exception = null;
704705
for(ScopURLs mirror:mirrors) {
705706
try {
706707
URL url = new URL(mirror.getClaURL(scopVersion));
@@ -709,18 +710,20 @@ protected void downloadClaFile() throws FileNotFoundException, IOException{
709710
File localFile = new File(localFileName);
710711

711712
downloadFileFromRemote(url, localFile);
712-
break;
713+
return;
713714
} catch(IOException e ) {
715+
exception = e;
714716
continue;
715717
}
716718
}
717-
throw new IOException("Unable to download SCOP .cla file");
719+
throw new IOException("Unable to download SCOP .cla file",exception);
718720
}
719721

720722
protected void downloadDesFile() throws FileNotFoundException, IOException{
721723
if(mirrors.size()<1) {
722724
initScopURLs();
723725
}
726+
IOException exception = null;
724727
for(ScopURLs mirror:mirrors) {
725728
try {
726729
URL url = new URL(mirror.getDesURL( scopVersion));
@@ -729,18 +732,20 @@ protected void downloadDesFile() throws FileNotFoundException, IOException{
729732
File localFile = new File(localFileName);
730733

731734
downloadFileFromRemote(url, localFile);
732-
break;
735+
return;
733736
} catch(IOException e ) {
737+
exception = e;
734738
continue;
735739
}
736740
}
737-
throw new IOException("Unable to download SCOP .des file");
741+
throw new IOException("Unable to download SCOP .des file",exception);
738742
}
739743

740744
protected void downloadHieFile() throws FileNotFoundException, IOException{
741745
if(mirrors.size()<1) {
742746
initScopURLs();
743747
}
748+
IOException exception = null;
744749
for(ScopURLs mirror:mirrors) {
745750
try {
746751
URL url = new URL(mirror.getHieURL( scopVersion));
@@ -749,19 +754,21 @@ protected void downloadHieFile() throws FileNotFoundException, IOException{
749754
File localFile = new File(localFileName);
750755

751756
downloadFileFromRemote(url, localFile);
752-
break;
757+
return;
753758
} catch(IOException e ) {
759+
exception = e;
754760
continue;
755761
}
756762
}
757-
throw new IOException("Unable to download SCOP .hie file");
763+
throw new IOException("Unable to download SCOP .hie file",exception);
758764

759765
}
760766

761767
protected void downloadComFile() throws FileNotFoundException, IOException{
762768
if(mirrors.size()<1) {
763769
initScopURLs();
764770
}
771+
IOException exception = null;
765772
for(ScopURLs mirror:mirrors) {
766773
try {
767774
URL url = new URL(mirror.getComURL(scopVersion));
@@ -770,14 +777,13 @@ protected void downloadComFile() throws FileNotFoundException, IOException{
770777
File localFile = new File(localFileName);
771778

772779
downloadFileFromRemote(url, localFile);
773-
break;
780+
return;
774781
} catch(IOException e ) {
782+
exception = e;
775783
continue;
776784
}
777785
}
778-
throw new IOException("Unable to download SCOP .com file");
779-
780-
786+
throw new IOException("Unable to download SCOP .com file",exception);
781787
}
782788

783789
protected void downloadFileFromRemote(URL remoteURL, File localFile) throws FileNotFoundException, IOException{

0 commit comments

Comments
 (0)