merge from 2_4_Release branch
[jalview.git] / src / org / biojava / dasobert / das2 / io / DasSourceReaderImpl.java
index af403ed..6b6122a 100755 (executable)
@@ -30,8 +30,7 @@ import org.biojava.dasobert.das.*;
 import org.biojava.dasobert.dasregistry.*;
 import org.xml.sax.*;
 
-public class DasSourceReaderImpl
-    implements DasSourceReader
+public class DasSourceReaderImpl implements DasSourceReader
 {
 
   Exception loggedException;
@@ -44,8 +43,8 @@ public class DasSourceReaderImpl
     // open the stream to a server and then parse the result ...
   }
 
-  private InputStream open(URL url)
-      throws java.io.IOException, java.net.ConnectException
+  private InputStream open(URL url) throws java.io.IOException,
+          java.net.ConnectException
   {
     InputStream inStream = null;
 
@@ -66,8 +65,7 @@ public class DasSourceReaderImpl
       InputStream stream = open(url);
 
       sources = readDasSource(stream);
-    }
-    catch (Exception e)
+    } catch (Exception e)
     {
       e.printStackTrace();
       loggedException = e;
@@ -75,8 +73,9 @@ public class DasSourceReaderImpl
     return sources;
   }
 
-  /** read a DAS2 sources response and return a list of DAS sources.
-   *
+  /**
+   * read a DAS2 sources response and return a list of DAS sources.
+   * 
    */
   public DasSource[] readDasSource(InputStream stream)
   {
@@ -85,8 +84,7 @@ public class DasSourceReaderImpl
 
     try
     {
-      SAXParserFactory spfactory =
-          SAXParserFactory.newInstance();
+      SAXParserFactory spfactory = SAXParserFactory.newInstance();
 
       spfactory.setValidating(false);
 
@@ -94,10 +92,8 @@ public class DasSourceReaderImpl
 
       try
       {
-        saxParser =
-            spfactory.newSAXParser();
-      }
-      catch (ParserConfigurationException e)
+        saxParser = spfactory.newSAXParser();
+      } catch (ParserConfigurationException e)
       {
         e.printStackTrace();
         loggedException = e;
@@ -116,27 +112,26 @@ public class DasSourceReaderImpl
 
       XMLReader xmlreader = saxParser.getXMLReader();
 
-      //XMLReader xmlreader = XMLReaderFactory.createXMLReader();
+      // XMLReader xmlreader = XMLReaderFactory.createXMLReader();
       try
       {
         xmlreader.setFeature("http://xml.org/sax/features/validation",
-                             validation);
-      }
-      catch (SAXException e)
+                validation);
+      } catch (SAXException e)
       {
-        //logger.log(Level.FINE,"Cannot set validation " + validation);
+        // logger.log(Level.FINE,"Cannot set validation " + validation);
       }
 
       try
       {
-        xmlreader.setFeature(
-            "http://apache.org/xml/features/nonvalidating/load-external-dtd",
-            validation);
-      }
-      catch (SAXNotRecognizedException e)
+        xmlreader
+                .setFeature(
+                        "http://apache.org/xml/features/nonvalidating/load-external-dtd",
+                        validation);
+      } catch (SAXNotRecognizedException e)
       {
         e.printStackTrace();
-        //logger.log(Level.FINE,"Cannot set load-external-dtd "+validation);
+        // logger.log(Level.FINE,"Cannot set load-external-dtd "+validation);
 
       }
 
@@ -150,8 +145,7 @@ public class DasSourceReaderImpl
       xmlreader.parse(insource);
       sources = cont_handle.getSources();
 
-    }
-    catch (Exception e)
+    } catch (Exception e)
     {
       e.printStackTrace();
       loggedException = e;
@@ -178,8 +172,7 @@ public class DasSourceReaderImpl
         System.out.println(ds.toString());
       }
 
-    }
-    catch (Exception e)
+    } catch (Exception e)
     {
       e.printStackTrace();
     }